Struct SlotImpl

Source
pub struct SlotImpl<T> { /* private fields */ }
Expand description

The main implementation for Slot trait. Allows to pull data from queue.

Implementations§

Source§

impl<T> SlotImpl<T>

Source

pub fn new() -> SlotImpl<T>

Creates new instance

Source

pub fn next(&self) -> Option<T>

Try to obtain next value from SlotImpl’s queue.

Source

pub fn data_iter(&self) -> TryIter<'_, T>

Return TryIter to access to the queue’s content

Source

pub fn last(&self) -> Option<T>

Return last element from the queue

Source

pub fn discard_pending(&self)

Clean queue

Source

pub fn exec_for(&self, t: T) -> bool

Add new data instance to the queue

Source

pub fn proxy(&self) -> SlotProxy<T>

Creates proxy which is refer to the SlotImpl

Trait Implementations§

Source§

impl<T> Default for SlotImpl<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T> Slot<T> for SlotImpl<T>

Source§

fn exec_for(&self, t: T) -> bool

Add new instance of data to the queue. Read more
Source§

fn proxy(&self) -> SlotProxy<T>

Creates SlotProxy for particular slot. The SlotProxy may be saved separatedly from the original Slot but still may be used to send new instance of data to the original Slot. SlotProxy do not provide any mechanism to retrive data from the queue. Read more

Auto Trait Implementations§

§

impl<T> Freeze for SlotImpl<T>

§

impl<T> RefUnwindSafe for SlotImpl<T>

§

impl<T> Send for SlotImpl<T>
where T: Send,

§

impl<T> !Sync for SlotImpl<T>

§

impl<T> Unpin for SlotImpl<T>

§

impl<T> UnwindSafe for SlotImpl<T>

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>,

Source§

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>,

Source§

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.