pub struct FileList { /* private fields */ }Expand description
A file: the list of its chunks, in the file’s order.
Implementations§
Source§impl FileList
impl FileList
Sourcepub fn new(items: Vec<ChunkRef>) -> Result<Self>
pub fn new(items: Vec<ChunkRef>) -> Result<Self>
The file with these chunks, in this order. A chunk that occurs twice is listed twice. No chunks at all is the empty file.
pub fn encode(&self) -> Vec<u8> ⓘ
pub fn items(&self) -> &[ChunkRef]
Sourcepub fn hash(&self) -> &Hash
pub fn hash(&self) -> &Hash
The file’s hash. It covers the chunks, their order, how many there are and the size, and nothing about where the file sits.
pub fn target(&self) -> Target
Sourcepub fn encoded_len(&self) -> u64
pub fn encoded_len(&self) -> u64
How many bytes the list takes.
Sourcepub fn check_chunking(&self, chunking: Chunking) -> Result<()>
pub fn check_chunking(&self, chunking: Chunking) -> Result<()>
Whether every chunk has a length that chunking gives.
Trait Implementations§
impl Eq for FileList
impl StructuralPartialEq for FileList
Auto Trait Implementations§
impl Forget for FileList
impl Freeze for FileList
impl Move for FileList
impl RefUnwindSafe for FileList
impl Send for FileList
impl Sync for FileList
impl Unpin for FileList
impl UnsafeUnpin for FileList
impl UnwindSafe for FileList
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,
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