pub struct ChangeBuffer<T> { /* private fields */ }Expand description
A ChangeBuffer enables order-sensitive buffering of changes, and is meant to be used when traversing incremental revisions of a sphere. If changes are buffered in history order, they can be flushed and the flusher will be able to work with a flattened representation of all those changes.
Implementations§
Source§impl<T> ChangeBuffer<T>
impl<T> ChangeBuffer<T>
Sourcepub fn new(capacity: usize) -> Self
pub fn new(capacity: usize) -> Self
Initialize a ChangeBuffer with the given capacity. When the capacity is reached, the ChangeBuffer must be flushed before additional changes are buffered.
Sourcepub fn is_full(&self) -> bool
pub fn is_full(&self) -> bool
Returns true if the ChangeBuffer is full
Source§impl<R> ChangeBuffer<SphereFile<R>>where
R: AsyncFileBody + 'static,
impl<R> ChangeBuffer<SphereFile<R>>where
R: AsyncFileBody + 'static,
Sourcepub async fn flush_to_writer(&mut self, writer: &SphereWriter) -> Result<()>
pub async fn flush_to_writer(&mut self, writer: &SphereWriter) -> Result<()>
Flush the ChangeBuffer to a SphereWriter for the case where we are dealing in sphere content
Source§impl ChangeBuffer<(Did, Cid)>
impl ChangeBuffer<(Did, Cid)>
Sourcepub async fn flush_to_writer(&mut self, writer: &SphereWriter) -> Result<()>
pub async fn flush_to_writer(&mut self, writer: &SphereWriter) -> Result<()>
Flush the ChangeBuffer to a SphereWriter for the case where we are dealing with peer references
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ChangeBuffer<T>
impl<T> RefUnwindSafe for ChangeBuffer<T>where
T: RefUnwindSafe,
impl<T> Send for ChangeBuffer<T>where
T: Send,
impl<T> Sync for ChangeBuffer<T>where
T: Sync,
impl<T> Unpin for ChangeBuffer<T>
impl<T> UnwindSafe for ChangeBuffer<T>where
T: RefUnwindSafe,
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> FitForCBox for T
impl<T> FitForCBox for T
type CBoxWrapped = Box_<T>
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