pub struct EncodedPostBundleV1 {
pub header: EncodedPostBundleHeaderV1,
pub encoded_posts_bytes: Bytes,
}Fields§
§header: EncodedPostBundleHeaderV1§encoded_posts_bytes: BytesImplementations§
Source§impl EncodedPostBundleV1
impl EncodedPostBundleV1
pub fn to_bytes(&self) -> Result<Bytes>
pub fn from_bytes(bytes: Bytes, decode_body: bool) -> Result<Self>
Sourcepub fn verify(&self, base_id: &Id) -> Result<()>
pub fn verify(&self, base_id: &Id) -> Result<()>
Verifies that this bundle is legitimate enough to cache.
Checks:
- The bundle header is structurally valid and its signature verifies.
- The sum of
encoded_post_lengthsexactly spansencoded_posts_bytes, and the plaintextpost_idprefix of each slice matches the corresponding entry inencoded_post_ids. - Each post slice can be decrypted using
base_id, which also verifies the per-post signature and hash integrity.
Trait Implementations§
Source§impl Clone for EncodedPostBundleV1
impl Clone for EncodedPostBundleV1
Source§fn clone(&self) -> EncodedPostBundleV1
fn clone(&self) -> EncodedPostBundleV1
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EncodedPostBundleV1
impl Debug for EncodedPostBundleV1
Source§impl Display for EncodedPostBundleV1
impl Display for EncodedPostBundleV1
Source§impl PartialEq for EncodedPostBundleV1
impl PartialEq for EncodedPostBundleV1
impl StructuralPartialEq for EncodedPostBundleV1
Auto Trait Implementations§
impl !Freeze for EncodedPostBundleV1
impl RefUnwindSafe for EncodedPostBundleV1
impl Send for EncodedPostBundleV1
impl Sync for EncodedPostBundleV1
impl Unpin for EncodedPostBundleV1
impl UnsafeUnpin for EncodedPostBundleV1
impl UnwindSafe for EncodedPostBundleV1
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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.