pub struct WriteContext<'a> {
pub compressor: &'a dyn Compressor,
pub encryptor: Option<&'a dyn Encryptor>,
pub hasher: &'a dyn ContentHasher,
pub hash_buf: &'a mut [u8; 32],
pub compress_buf: &'a mut Vec<u8>,
pub encrypt_buf: &'a mut Vec<u8>,
}Expand description
Reusable context for block write operations.
Bundles the compressor, encryptor, hasher, and scratch buffers needed by
write_block so that callers do not have to pass many individual arguments.
Fields§
§compressor: &'a dyn CompressorCompressor used to compress block data.
encryptor: Option<&'a dyn Encryptor>Optional encryptor for per-block encryption.
hasher: &'a dyn ContentHasherContent hasher for deduplication.
hash_buf: &'a mut [u8; 32]Scratch buffer for hash output.
compress_buf: &'a mut Vec<u8>Scratch buffer for compressed data.
encrypt_buf: &'a mut Vec<u8>Scratch buffer for encrypted data.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for WriteContext<'a>
impl<'a> !RefUnwindSafe for WriteContext<'a>
impl<'a> Send for WriteContext<'a>
impl<'a> Sync for WriteContext<'a>
impl<'a> Unpin for WriteContext<'a>
impl<'a> UnsafeUnpin for WriteContext<'a>
impl<'a> !UnwindSafe for WriteContext<'a>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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