pub struct OutputWrapper<T: Timestamp, CB: ContainerBuilder, P: Push<Message<T, CB::Container>>> { /* private fields */ }
Expand description
An owned instance of an output buffer which ensures certain API use.
An OutputWrapper
exists to prevent anyone from using the wrapped buffer in any way other
than with an OutputHandle
, whose methods ensure that capabilities are used and that the
pusher is flushed (via the cease
method) once it is no longer used.
Implementations§
source§impl<T: Timestamp, CB: ContainerBuilder, P: Push<Message<T, CB::Container>>> OutputWrapper<T, CB, P>
impl<T: Timestamp, CB: ContainerBuilder, P: Push<Message<T, CB::Container>>> OutputWrapper<T, CB, P>
sourcepub fn new(
push_buffer: Buffer<T, CB, PushCounter<T, CB::Container, P>>,
internal_buffer: Rc<RefCell<ChangeBatch<T>>>,
) -> Self
pub fn new( push_buffer: Buffer<T, CB, PushCounter<T, CB::Container, P>>, internal_buffer: Rc<RefCell<ChangeBatch<T>>>, ) -> Self
Creates a new output wrapper from a push buffer.
sourcepub fn activate(&mut self) -> OutputHandleCore<'_, T, CB, P>
pub fn activate(&mut self) -> OutputHandleCore<'_, T, CB, P>
Borrows the push buffer into a handle, which can be used to send records.
This method ensures that the only access to the push buffer is through the OutputHandle
type which ensures the use of capabilities, and which calls cease
when it is dropped.
Trait Implementations§
Auto Trait Implementations§
impl<T, CB, P> Freeze for OutputWrapper<T, CB, P>
impl<T, CB, P> !RefUnwindSafe for OutputWrapper<T, CB, P>
impl<T, CB, P> !Send for OutputWrapper<T, CB, P>
impl<T, CB, P> !Sync for OutputWrapper<T, CB, P>
impl<T, CB, P> Unpin for OutputWrapper<T, CB, P>
impl<T, CB, P> !UnwindSafe for OutputWrapper<T, CB, P>
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