pub enum BlobBytes<'a> {
Inline(&'a [u8]),
Original(&'a OriginalCiphertext),
}Expand description
Where a BundleBlob’s bytes come from. Everything but the original is small and already
in the bundle; the original is a OriginalCiphertext source the upload client reads one
chunk window at a time, so a push never holds an original whole.
Variants§
Inline(&'a [u8])
Bytes the bundle holds: the provenance and metadata blobs, derivative manifests and derivatives.
Original(&'a OriginalCiphertext)
The original’s ciphertext, re-derived per window from the plaintext on disk.
Implementations§
Trait Implementations§
impl<'a> Copy for BlobBytes<'a>
Source§impl UploadSource for BlobBytes<'_>
impl UploadSource for BlobBytes<'_>
Source§fn check_unchanged(&self) -> Result<SourceIdentity, SourceChanged>
fn check_unchanged(&self) -> Result<SourceIdentity, SourceChanged>
Inline bytes cannot change and affirm it. An original affirms while its plaintext file still has the length, modification time and (on Unix) inode and status-change time it had when the bundle verified its ciphertext, and is changed otherwise.
Source§fn verifies_rederived(&self) -> bool
fn verifies_rederived(&self) -> bool
Both verify what they return: inline bytes cannot change, and an original checks every re-derived STREAM chunk against the tag its bundle recorded.
Source§fn read_at(&self, offset: u64, len: usize) -> Result<Cow<'_, [u8]>>
fn read_at(&self, offset: u64, len: usize) -> Result<Cow<'_, [u8]>>
[offset, offset + len). Fewer than len bytes is a source error: the
declared size is the blob’s, and a short read means the source changed under the upload.
A source that finds what it re-derived differs from what it first sealed returns an
error carrying SourceChanged, which ends the transfer typed.Auto Trait Implementations§
impl<'a> Freeze for BlobBytes<'a>
impl<'a> RefUnwindSafe for BlobBytes<'a>
impl<'a> Send for BlobBytes<'a>
impl<'a> Sync for BlobBytes<'a>
impl<'a> Unpin for BlobBytes<'a>
impl<'a> UnsafeUnpin for BlobBytes<'a>
impl<'a> UnwindSafe for BlobBytes<'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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> 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>
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>
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