pub struct FileWithChunks {
pub path: String,
pub size: u64,
pub mtime: SystemTime,
/* private fields */
}Expand description
Represents a file in the source tree along with its chunked representation.
Fields§
§path: StringPath of the file relative to the source root.
size: u64File size in bytes.
mtime: SystemTimeModification time of the file.
Implementations§
Source§impl FileWithChunks
impl FileWithChunks
Sourcepub fn try_new(
source_path: impl Into<PathBuf>,
path: impl Into<PathBuf>,
hashing_algorithm: HashingAlgorithm,
) -> Result<Self, Error>
pub fn try_new( source_path: impl Into<PathBuf>, path: impl Into<PathBuf>, hashing_algorithm: HashingAlgorithm, ) -> Result<Self, Error>
Creates a new instance by reading metadata from path under source_path.
Sourcepub fn get_chunks(&self) -> Option<&Vec<FileChunk>>
pub fn get_chunks(&self) -> Option<&Vec<FileChunk>>
Returns already computed chunks if present.
Sourcepub fn take_chunks(&mut self) -> Option<Vec<FileChunk>>
pub fn take_chunks(&mut self) -> Option<Vec<FileChunk>>
Returns already computed chunks if present and consumes them.
Trait Implementations§
Source§impl Clone for FileWithChunks
impl Clone for FileWithChunks
Source§fn clone(&self) -> FileWithChunks
fn clone(&self) -> FileWithChunks
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 FileWithChunks
impl Debug for FileWithChunks
Source§impl PartialEq for FileWithChunks
impl PartialEq for FileWithChunks
impl Eq for FileWithChunks
Auto Trait Implementations§
impl !Freeze for FileWithChunks
impl !RefUnwindSafe for FileWithChunks
impl Send for FileWithChunks
impl !Sync for FileWithChunks
impl Unpin for FileWithChunks
impl UnwindSafe for FileWithChunks
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