Struct timely::dataflow::channels::pushers::buffer::Buffer

source ·
pub struct Buffer<T, CB, P> { /* private fields */ }
Expand description

Buffers data sent at the same time, for efficient communication.

The Buffer type should be used by calling session with a time, which checks whether data must be flushed and creates a Session object which allows sending at the given time.

Implementations§

source§

impl<T, CB: Default, P> Buffer<T, CB, P>

source

pub fn new(pusher: P) -> Self

Creates a new Buffer.

source

pub fn inner(&mut self) -> &mut P

Returns a reference to the inner P: Push type.

This is currently used internally, and should not be used without some care.

source

pub fn builder(&self) -> &CB

Access the builder. Immutable access to prevent races with flushing the underlying buffer.

source§

impl<T, C: Container, P: Push<Bundle<T, C>>> Buffer<T, CapacityContainerBuilder<C>, P>
where T: Eq + Clone,

source

pub fn session( &mut self, time: &T, ) -> Session<'_, T, CapacityContainerBuilder<C>, P>

Returns a Session, which accepts data to send at the associated time

source

pub fn autoflush_session( &mut self, cap: Capability<T>, ) -> AutoflushSession<'_, T, CapacityContainerBuilder<C>, P>
where T: Timestamp,

Allocates a new AutoflushSession which flushes itself on drop.

source§

impl<T, CB: ContainerBuilder, P: Push<Bundle<T, CB::Container>>> Buffer<T, CB, P>
where T: Eq + Clone,

source

pub fn session_with_builder(&mut self, time: &T) -> Session<'_, T, CB, P>

Returns a Session, which accepts data to send at the associated time

source

pub fn autoflush_session_with_builder( &mut self, cap: Capability<T>, ) -> AutoflushSession<'_, T, CB, P>
where T: Timestamp,

Allocates a new AutoflushSession which flushes itself on drop.

source§

impl<T, CB: ContainerBuilder, P: Push<Bundle<T, CB::Container>>> Buffer<T, CB, P>
where T: Eq + Clone,

source

pub fn cease(&mut self)

Flushes all data and pushes a None to self.pusher, indicating a flush.

Trait Implementations§

source§

impl<T: Debug, CB: Debug, P: Debug> Debug for Buffer<T, CB, P>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, CB, P, D> PushInto<D> for Buffer<T, CB, P>
where T: Eq + Clone, CB: ContainerBuilder + PushInto<D>, P: Push<Bundle<T, CB::Container>>,

source§

fn push_into(&mut self, item: D)

Push item into self.

Auto Trait Implementations§

§

impl<T, CB, P> Freeze for Buffer<T, CB, P>
where CB: Freeze, P: Freeze, T: Freeze,

§

impl<T, CB, P> RefUnwindSafe for Buffer<T, CB, P>

§

impl<T, CB, P> Send for Buffer<T, CB, P>
where CB: Send, P: Send, T: Send,

§

impl<T, CB, P> Sync for Buffer<T, CB, P>
where CB: Sync, P: Sync, T: Sync,

§

impl<T, CB, P> Unpin for Buffer<T, CB, P>
where CB: Unpin, P: Unpin, T: Unpin,

§

impl<T, CB, P> UnwindSafe for Buffer<T, CB, P>
where CB: UnwindSafe, P: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.