Struct batch_system::batch::Batch[][src]

pub struct Batch<N, C> {
    normals: Vec<Box<N>>,
    timers: Vec<Instant>,
    control: Option<Box<C>>,
}

A basic struct for a round of polling.

Fields

normals: Vec<Box<N>>timers: Vec<Instant>control: Option<Box<C>>

Implementations

impl<N: Fsm, C: Fsm> Batch<N, C>[src]

pub fn with_capacity(cap: usize) -> Batch<N, C>[src]

Create a a batch with given batch size.

fn push(&mut self, fsm: FsmTypes<N, C>) -> bool[src]

fn is_empty(&self) -> bool[src]

fn clear(&mut self)[src]

pub fn release(&mut self, index: usize, checked_len: usize)[src]

Put back the FSM located at index.

Only when channel length is larger than checked_len will trigger further notification. This function may fail if channel length is larger than the given value before FSM is released.

pub fn remove(&mut self, index: usize)[src]

Remove the normal FSM located at index.

This method should only be called when the FSM is stopped. If there are still messages in channel, the FSM is untouched and the function will return false to let caller to keep polling.

pub fn reschedule(&mut self, router: &BatchRouter<N, C>, index: usize)[src]

Schedule the normal FSM located at index.

pub fn release_control(
    &mut self,
    control_box: &BasicMailbox<C>,
    checked_len: usize
) -> bool
[src]

Same as release, but working on control FSM.

pub fn remove_control(&mut self, control_box: &BasicMailbox<C>)[src]

Same as remove, but working on control FSM.

Auto Trait Implementations

impl<N, C> RefUnwindSafe for Batch<N, C> where
    C: RefUnwindSafe,
    N: RefUnwindSafe

impl<N, C> Send for Batch<N, C> where
    C: Send,
    N: Send

impl<N, C> Sync for Batch<N, C> where
    C: Sync,
    N: Sync

impl<N, C> Unpin for Batch<N, C>

impl<N, C> UnwindSafe for Batch<N, C> where
    C: UnwindSafe,
    N: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]