pub struct EncodedPostBundleHeaderV1 {
pub time_millis: TimeMillis,
pub location_id: Id,
pub overflowed: bool,
pub sealed: bool,
pub num_posts: u8,
pub encoded_post_ids: Vec<Id>,
pub encoded_post_lengths: Vec<usize>,
pub encoded_post_healed: HashSet<Id>,
pub peer: Peer,
pub signature: Signature,
}Expand description
The server-signed index for all posts accumulated under one (location, time-bucket) key.
Posts on hashiverse are not stored one-by-one on the DHT: they are grouped into “bundles”
keyed by a crate::tools::buckets::BucketLocation (a location_id plus a time bucket).
An EncodedPostBundleHeaderV1 is the header that a server publishes describing the
bundle’s current state — the list of post IDs it holds, their lengths, which ones have
been healed (re-uploaded after loss), whether the bundle has overflowed (too many posts,
go more granular), whether it is sealed (old enough that new posts are unlikely), and the
Peer record of the server publishing it.
The whole header is signed by the publishing peer, which lets any client reading the bundle verify both the contents list and the identity of the hosting server before deciding to fetch individual posts.
Fields§
§time_millis: TimeMillis§location_id: Id§overflowed: bool§sealed: bool§num_posts: u8§encoded_post_ids: Vec<Id>§encoded_post_lengths: Vec<usize>§encoded_post_healed: HashSet<Id>§peer: Peer§signature: SignatureImplementations§
Source§impl EncodedPostBundleHeaderV1
impl EncodedPostBundleHeaderV1
pub fn get_hash_for_signing(&self) -> Result<Hash>
pub fn signature_generate(&mut self, signature_key: &SignatureKey) -> Result<()>
pub fn signature_verify(&self) -> Result<()>
pub fn verify(&self) -> Result<()>
Trait Implementations§
Source§impl Clone for EncodedPostBundleHeaderV1
impl Clone for EncodedPostBundleHeaderV1
Source§fn clone(&self) -> EncodedPostBundleHeaderV1
fn clone(&self) -> EncodedPostBundleHeaderV1
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EncodedPostBundleHeaderV1
impl Debug for EncodedPostBundleHeaderV1
Source§impl<'de> Deserialize<'de> for EncodedPostBundleHeaderV1
impl<'de> Deserialize<'de> for EncodedPostBundleHeaderV1
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for EncodedPostBundleHeaderV1
impl Display for EncodedPostBundleHeaderV1
impl StructuralPartialEq for EncodedPostBundleHeaderV1
Auto Trait Implementations§
impl Freeze for EncodedPostBundleHeaderV1
impl RefUnwindSafe for EncodedPostBundleHeaderV1
impl Send for EncodedPostBundleHeaderV1
impl Sync for EncodedPostBundleHeaderV1
impl Unpin for EncodedPostBundleHeaderV1
impl UnsafeUnpin for EncodedPostBundleHeaderV1
impl UnwindSafe for EncodedPostBundleHeaderV1
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.