Struct Driver

Source
pub struct Driver<P, Ext = ()>(/* private fields */);

Implementations§

Source§

impl<P, Ext> Driver<P, Ext>

Source

pub const fn new() -> Self

Source

pub fn with_capacity(capacity: usize) -> Self

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn contains(&self, id: OpId) -> bool

Source

pub fn submit(&self) -> OpId
where Ext: Default,

Source

pub fn submit_ext(&self, ext: Ext) -> OpId

Source

pub fn try_submit(&self) -> Result<OpId, Ext>
where Ext: Default,

Submits an operation if there is sufficient spare capacity, otherwise an error is returned with the element.

Source

pub fn try_submit_ext(&self, ext: Ext) -> Result<OpId, Ext>

Source

pub fn complete(&self, id: OpId, payload: P) -> Result<(), P>

Completes a operation. It returns the given payload as an Err if the specified operation has been cancelled.

The given id is always recycled even if the corresponding operation is cancelled.

Source

pub fn complete_ext(&self, id: OpId, payload: P) -> Result<(), (P, Ext)>

Completes a operation with the submitted extension.

For more information, see complete.

Trait Implementations§

Source§

impl<P, Ext> Default for Driver<P, Ext>
where Ext: Default,

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<P, Ext = ()> !Freeze for Driver<P, Ext>

§

impl<P, Ext = ()> !RefUnwindSafe for Driver<P, Ext>

§

impl<P, Ext = ()> !Send for Driver<P, Ext>

§

impl<P, Ext = ()> !Sync for Driver<P, Ext>

§

impl<P, Ext> Unpin for Driver<P, Ext>
where Ext: Unpin, P: Unpin,

§

impl<P, Ext = ()> !UnwindSafe for Driver<P, Ext>

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.