pub struct DropSliceMetadata { /* private fields */ }Expand description
The metadata associated with one payload slice decoded from data in the Willow drop format.
This metadata consists of the AuthorisedEntry of which the slice is a part, the chunk index
at which the slice starts, the number of chunks in the slice, and the left_skip minimising
the verification data required for this slice in the context of the drop.
The drop format APIs usually work with producers of payload slices, paired with a DropSliceMetadata. The entries that make up a drop are typically communicated only through the entry field of the DropSliceMetadata.
Implementations§
Source§impl DropSliceMetadata
impl DropSliceMetadata
Sourcepub fn new(
entry: AuthorisedEntry,
first_chunk: u64,
chunk_count: u64,
left_skip: u8,
is_multislice_encoded: bool,
) -> Result<Self, SliceMetadataError>
pub fn new( entry: AuthorisedEntry, first_chunk: u64, chunk_count: u64, left_skip: u8, is_multislice_encoded: bool, ) -> Result<Self, SliceMetadataError>
Creates a new DropSliceMetadata describing the 64-grouped baseline verifiable slice stream of the slice of entry from first_chunk to first_chunk + chunk_count.
Sourcepub fn entry(&self) -> &AuthorisedEntry
pub fn entry(&self) -> &AuthorisedEntry
Returns the AuthorisedEntry to which the payload slice described by self contributes.
Sourcepub fn first_chunk(&self) -> u64
pub fn first_chunk(&self) -> u64
Returns in the index in the total payload of the first chunk of the payload slice described by self.
Sourcepub fn chunk_count(&self) -> u64
pub fn chunk_count(&self) -> u64
Returns the number of chunks in the payload slice described by self.
Sourcepub fn left_skip(&self) -> u8
pub fn left_skip(&self) -> u8
Returns the left_skip used to encode the payload slice described by self.
Sourcepub fn resumption_info(&self) -> SliceStreamResumptionInfo
pub fn resumption_info(&self) -> SliceStreamResumptionInfo
Returns the SliceStreamResumptionInfo indicating where the payload slice described by self can be appended to existing payload data.
Sourcepub fn streaming_options(&self) -> SliceStreamingOptions
pub fn streaming_options(&self) -> SliceStreamingOptions
Returns the SliceStreamingOptions used to encode the payload slice described by self.
Sourcepub fn expected_bytes(&self) -> u64
pub fn expected_bytes(&self) -> u64
Returns the number of bytes which are expected to occur in the 64-grouped baseline verifiable stream of the payload slice described by self.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns true if the payload slice described by self covers the complete payload of the entry, else false.
Sourcepub fn is_multislice(&self) -> bool
pub fn is_multislice(&self) -> bool
Returns true if the payload slice described by self might be one of multiple slices from the same entry in the drop, else false.
Trait Implementations§
Source§impl Clone for DropSliceMetadata
impl Clone for DropSliceMetadata
Source§fn clone(&self) -> DropSliceMetadata
fn clone(&self) -> DropSliceMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for DropSliceMetadata
impl RefUnwindSafe for DropSliceMetadata
impl Send for DropSliceMetadata
impl Sync for DropSliceMetadata
impl Unpin for DropSliceMetadata
impl UnsafeUnpin for DropSliceMetadata
impl UnwindSafe for DropSliceMetadata
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,
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