pub struct CiphertextReader<R> { /* private fields */ }Expand description
Random-access re-derivation of a STREAM ciphertext from its plaintext.
A chunk’s ciphertext is a function of the key, the nonce prefix, the chunk’s plaintext, its index and whether it is the last chunk, so any byte range of the ciphertext can be produced by reading and encrypting only the plaintext chunks that range covers. That is what lets an upload send — and re-send, on a resume or a realign — any window of an original without the ciphertext ever existing in memory or on disk.
plaintext_size is the size the signed manifest committed to. The reader never reads past
it, and a source shorter than it is an io::ErrorKind::UnexpectedEof rather than a short
ciphertext.
Implementations§
Source§impl<R: Read + Seek> CiphertextReader<R>
impl<R: Read + Seek> CiphertextReader<R>
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for CiphertextReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for CiphertextReader<R>where
R: RefUnwindSafe,
impl<R> Send for CiphertextReader<R>where
R: Send,
impl<R> Sync for CiphertextReader<R>where
R: Sync,
impl<R> Unpin for CiphertextReader<R>where
R: Unpin,
impl<R> UnsafeUnpin for CiphertextReader<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for CiphertextReader<R>where
R: UnwindSafe,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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