pub struct Append<B: Blob> { /* private fields */ }
Expand description
A Blob wrapper that supports appending new data that is both read and write cached, and provides buffer-pool managed read caching of older data.
Implementations§
Source§impl<B: Blob> Append<B>
impl<B: Blob> Append<B>
Sourcepub async fn new(
blob: B,
size: u64,
buffer_size: NonZeroUsize,
pool_ref: PoolRef,
) -> Result<Self, Error>
pub async fn new( blob: B, size: u64, buffer_size: NonZeroUsize, pool_ref: PoolRef, ) -> Result<Self, Error>
Create a new Append of provided size
using the provided pool
for read caching, and a
write buffer with capacity buffer_size
.
Sourcepub async fn append(
&self,
buf: impl Into<StableBuf> + Send,
) -> Result<(), Error>
pub async fn append( &self, buf: impl Into<StableBuf> + Send, ) -> Result<(), Error>
Append all bytes in buf
to the tip of the blob.
Sourcepub async fn size(&self) -> u64
pub async fn size(&self) -> u64
Returns the current logical size of the blob including any buffered data.
This represents the total size of data that would be present after flushing.
Sourcepub fn clone_blob(&self) -> B
pub fn clone_blob(&self) -> B
Clones and returns the underlying blob.
Trait Implementations§
Source§impl<B: Blob> Blob for Append<B>
impl<B: Blob> Blob for Append<B>
Auto Trait Implementations§
impl<B> Freeze for Append<B>where
B: Freeze,
impl<B> !RefUnwindSafe for Append<B>
impl<B> Send for Append<B>
impl<B> Sync for Append<B>
impl<B> Unpin for Append<B>where
B: Unpin,
impl<B> !UnwindSafe for Append<B>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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