pub struct BufferCore<T, D: Container, P: Push<BundleCore<T, D>>> { /* 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, C: Container, P: Push<BundleCore<T, C>>> BufferCore<T, C, P>
where T: Eq + Clone,

source

pub fn new(pusher: P) -> Self

Creates a new Buffer.

source

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

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

source

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

Allocates a new AutoflushSession which flushes itself on drop.

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 cease(&mut self)

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

Trait Implementations§

source§

impl<T: Debug, D: Debug + Container, P: Debug + Push<BundleCore<T, D>>> Debug for BufferCore<T, D, P>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T, D, P> RefUnwindSafe for BufferCore<T, D, P>

§

impl<T, D, P> Send for BufferCore<T, D, P>
where D: Send, P: Send, T: Send,

§

impl<T, D, P> Sync for BufferCore<T, D, P>
where D: Sync, P: Sync, T: Sync,

§

impl<T, D, P> Unpin for BufferCore<T, D, P>
where D: Unpin, P: Unpin, T: Unpin,

§

impl<T, D, P> UnwindSafe for BufferCore<T, D, P>
where D: 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> PushInto<Vec<T>> for T

source§

fn push_into(self, target: &mut Vec<T>)

Push self into the target container.
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.