pub struct StagedInputBuffer { /* private fields */ }Expand description
A wrapper around a StagedBuffers that implements the InputBuffer trait.
The StagedBuffers trait is similar to InputBuffer in that it supports flushing
a set of tuples to the circuit. Unlike InputBuffer, it doesn’t support returning
its size as a BufferSize. It also doesn’t support hashing and taking a subset of
records.
This wrapper adds the former by storing BufferSize collected from InputBuffers
used to create the StagedBuffers.
hash() and take_some() methods are unimplemented. Therefore this wrapper can only be
safely used in contexts where these methods are not needed.
Implementations§
Source§impl StagedInputBuffer
impl StagedInputBuffer
pub fn new(buffer: Box<dyn StagedBuffers>, size: BufferSize) -> Self
Trait Implementations§
Source§impl InputBuffer for StagedInputBuffer
impl InputBuffer for StagedInputBuffer
Source§fn flush(&mut self)
fn flush(&mut self)
Pushes all of the records into the circuit input handle, and discards
those records.
Source§fn len(&self) -> BufferSize
fn len(&self) -> BufferSize
Returns the number of buffered records and bytes.
Source§fn hash(&self, _hasher: &mut dyn Hasher)
fn hash(&self, _hasher: &mut dyn Hasher)
Hashes the records in the input buffer into
hasher, in order. This is
used to ensure that input data remains the same for replay, so, for
equal data, it should remain the same from one program run to the next.
Data might be divided into InputBuffers differently from one run to
the next, so the data fed into hasher should be the same if, for
example, records 0..10 then 10..20 are fed in one run and 0..5, 5..15,
15..20 in another.Source§fn take_some(&mut self, _n: usize) -> Option<Box<dyn InputBuffer>>
fn take_some(&mut self, _n: usize) -> Option<Box<dyn InputBuffer>>
Removes the first
n records from this input buffer and returns a new
InputBuffer that holds them. If fewer than n records are available,
returns all of them. May return None if this input buffer is empty (or
if n is 0). Read morefn is_empty(&self) -> bool
fn take_all(&mut self) -> Option<Box<dyn InputBuffer>>
Auto Trait Implementations§
impl !RefUnwindSafe for StagedInputBuffer
impl !UnwindSafe for StagedInputBuffer
impl Freeze for StagedInputBuffer
impl Send for StagedInputBuffer
impl Sync for StagedInputBuffer
impl Unpin for StagedInputBuffer
impl UnsafeUnpin for StagedInputBuffer
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.