pub struct BlobBody { /* private fields */ }Expand description
A blob as a sized stream of already-final bytes: sealed chunks for an
encrypted home, plaintext for a browsable one. Encryption-agnostic and
concrete (no dyn Stream). next_part hands the bytes to a streaming
upload in bounded windows so a large blob is never held whole in memory; the
only collect is the single-request path for blobs at or
below a provider’s multipart threshold.
Built by the cipher layer (CloudCipher::open_body), which knows scope→key and
plaintext-vs-encrypted, or by from_bytes for an
in-memory control object / the test backend.
Implementations§
Source§impl BlobBody
impl BlobBody
Sourcepub fn from_bytes(data: Vec<u8>) -> BlobBody
pub fn from_bytes(data: Vec<u8>) -> BlobBody
A body over already-final in-memory bytes — a sealed control object, or a
test payload. len is the byte count.
pub async fn from_file(path: &Path) -> Result<BlobBody, String>
pub fn from_test_reader(len: u64, reader: PlaintextReader) -> BlobBody
Sourcepub async fn next_part(
&mut self,
min: usize,
) -> Result<Option<Bytes>, CloudHomeError>
pub async fn next_part( &mut self, min: usize, ) -> Result<Option<Bytes>, CloudHomeError>
Return at least min bytes — exactly min when more remain, the remainder
at EOF — or None once fully drained. The driver calls this with the
provider’s part size, so every part except the last is exactly that size.
Auto Trait Implementations§
impl !Freeze for BlobBody
impl !RefUnwindSafe for BlobBody
impl Send for BlobBody
impl !Sync for BlobBody
impl Unpin for BlobBody
impl UnsafeUnpin for BlobBody
impl !UnwindSafe for BlobBody
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<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