pub struct MemoryPackSink { /* private fields */ }Expand description
The upload handle of MemoryBlobStore. It hashes incrementally and
buffers the blob: the one exception to PackSink’s one-part memory
bound, since this backend holds every blob in memory anyway.
Trait Implementations§
Source§impl Debug for MemoryPackSink
impl Debug for MemoryPackSink
Source§impl PackSink for MemoryPackSink
impl PackSink for MemoryPackSink
Source§async fn write(&mut self, chunk: Bytes) -> Result<(), StoreError>
async fn write(&mut self, chunk: Bytes) -> Result<(), StoreError>
Append a chunk. Writing past the declared length is
StoreError::Invalid.Source§async fn commit(self) -> Result<CommitOutcome, StoreError>
async fn commit(self) -> Result<CommitOutcome, StoreError>
Make the blob visible, only if
BLAKE3(bytes) == key and the total
equals the declared length; otherwise StoreError::Invalid and
nothing is visible (a streaming backend withholds its final part
until the hash verifies). Read moreSource§async fn commit_with_root(
self,
content_root: Hash,
) -> Result<CommitOutcome, StoreError>
async fn commit_with_root( self, content_root: Hash, ) -> Result<CommitOutcome, StoreError>
Make an object blob visible, only if the total equals the
declared length and
BLAKE3(bytes) == content_root (the key is the
object id, so it cannot be the hash of the bytes). Verification and
visibility are as for Self::commit: a streaming backend withholds
its final byte until the root verifies. A pack or marker key is
StoreError::Invalid. A backend that cannot verify a root is
StoreError::Unsupported, which is the default.Auto Trait Implementations§
impl Freeze for MemoryPackSink
impl RefUnwindSafe for MemoryPackSink
impl Send for MemoryPackSink
impl Sync for MemoryPackSink
impl Unpin for MemoryPackSink
impl UnsafeUnpin for MemoryPackSink
impl UnwindSafe for MemoryPackSink
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