pub struct ChunkManifest {
pub chunk_id: String,
pub chunk_index: usize,
pub original_size: usize,
pub fragment_locations: Vec<FragmentLocation>,
}Expand description
Manifest entry for a single chunk of a file.
Fields§
§chunk_id: StringBLAKE3 hash prefix (16 hex chars) of the encrypted chunk
(i.e. the data that was fed into rlnc::encode).
Encryption is performed with crate::storage::ChunkCipher before
RLNC coding, so Pouch nodes never hold plaintext data.
chunk_index: usizeZero-based index of this chunk in the file.
original_size: usizeOriginal byte count of this chunk (before padding and encryption). Used to trim padding after decoding.
fragment_locations: Vec<FragmentLocation>Where each of the n fragments lives in the network.
Implementations§
Source§impl ChunkManifest
impl ChunkManifest
Sourcepub fn fragments_on_peer<'a>(
&'a self,
peer_id: &str,
) -> Vec<&'a FragmentLocation>
pub fn fragments_on_peer<'a>( &'a self, peer_id: &str, ) -> Vec<&'a FragmentLocation>
Fragment locations on a specific peer (for fragment-fetch routing).
Sourcepub fn holder_peers(&self) -> Vec<&str>
pub fn holder_peers(&self) -> Vec<&str>
All Pouch peer IDs that hold at least one fragment of this chunk.
Trait Implementations§
Source§impl Clone for ChunkManifest
impl Clone for ChunkManifest
Source§fn clone(&self) -> ChunkManifest
fn clone(&self) -> ChunkManifest
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 ChunkManifest
impl Debug for ChunkManifest
Source§impl<'de> Deserialize<'de> for ChunkManifest
impl<'de> Deserialize<'de> for ChunkManifest
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ChunkManifest
impl RefUnwindSafe for ChunkManifest
impl Send for ChunkManifest
impl Sync for ChunkManifest
impl Unpin for ChunkManifest
impl UnwindSafe for ChunkManifest
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