pub struct ContentManifest {
pub digest: StrongDigest,
pub codec: u16,
pub decoded_len: u32,
pub range_count: u8,
/* private fields */
}Expand description
Immutable content identity: digest, codec, decoded bound, exact ranges.
Fields§
§digest: StrongDigest§codec: u16§decoded_len: u32§range_count: u8Implementations§
Source§impl ContentManifest
impl ContentManifest
Sourcepub fn bind(
digest: StrongDigest,
codec: u16,
decoded_len: u32,
ranges: &[ByteRange],
) -> Result<Self, QdnfError>
pub fn bind( digest: StrongDigest, codec: u16, decoded_len: u32, ranges: &[ByteRange], ) -> Result<Self, QdnfError>
Bind a manifest. Digest is not computed from a body here.
QdnfError::Malformed if digest is StrongDigest::ZERO or ranges is empty.
QdnfError::Range if decoded_len is 0 or greater than MAX_DECODED_BYTES,
or if offset + len overflows.
QdnfError::Capacity if ranges.len() > MAX_RANGES.
QdnfError::Overlap if any pair overlaps when ordered by offset
(end > next.offset). Adjacent ranges (end == next.offset) are allowed.
Unsorted input is compared pairwise without allocation.
Sourcepub fn range_count(&self) -> usize
pub fn range_count(&self) -> usize
ContentManifest::range_count.
Trait Implementations§
Source§impl Clone for ContentManifest
impl Clone for ContentManifest
impl Copy for ContentManifest
Source§impl Debug for ContentManifest
impl Debug for ContentManifest
impl Eq for ContentManifest
Source§impl PartialEq for ContentManifest
impl PartialEq for ContentManifest
impl StructuralPartialEq for ContentManifest
Auto Trait Implementations§
impl Freeze for ContentManifest
impl RefUnwindSafe for ContentManifest
impl Send for ContentManifest
impl Sync for ContentManifest
impl Unpin for ContentManifest
impl UnsafeUnpin for ContentManifest
impl UnwindSafe for ContentManifest
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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