pub struct DirHashAccumulator { /* private fields */ }Expand description
Accumulates S3 restore child entries per directory prefix, producing a
dir hash when finalize() is called for a given prefix.
Usage:
ⓘ
let mut acc = DirHashAccumulator::new();
acc.add("photos", "img001.jpg", 2_048_000, "abc123def456...");
acc.add("photos", "img002.jpg", 1_800_000, "789abc012def...");
let hash = acc.finalize("photos"); // Some([u8; 32])Implementations§
Source§impl DirHashAccumulator
impl DirHashAccumulator
pub fn new() -> Self
Sourcepub fn add(
&mut self,
prefix: impl Into<String>,
name: impl Into<String>,
size: u64,
hash_str: impl Into<String>,
)
pub fn add( &mut self, prefix: impl Into<String>, name: impl Into<String>, size: u64, hash_str: impl Into<String>, )
Add a child entry to the accumulator for the given prefix (dir path).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DirHashAccumulator
impl RefUnwindSafe for DirHashAccumulator
impl Send for DirHashAccumulator
impl Sync for DirHashAccumulator
impl Unpin for DirHashAccumulator
impl UnsafeUnpin for DirHashAccumulator
impl UnwindSafe for DirHashAccumulator
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
§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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.