twizzler_queue

Struct Queue

source
pub struct Queue<S, C> { /* private fields */ }
Expand description

A single queue, holding two subqueues (sending and completion). Objects of type S are sent across the sending queue, and completions of type C are sent back.

Implementations§

source§

impl<S: Copy, C: Copy> Queue<S, C>

source

pub fn object(&self) -> &Object<QueueBase<S, C>>

Get a handle to the internal object that holds the queue data.

source

pub fn create( create_spec: &CreateSpec, sub_queue_len: usize, com_queue_len: usize, ) -> Result<Self, CreateError>

Create a new Twizzler queue object.

source

pub fn submit( &self, id: u32, item: S, flags: SubmissionFlags, ) -> Result<(), QueueError>

Submit an item of type S across the sending subqueue, with a given id.

source

pub fn receive(&self, flags: ReceiveFlags) -> Result<(u32, S), QueueError>

Receive an item and request id from the sending subqueue.

source

pub fn complete( &self, id: u32, item: C, flags: SubmissionFlags, ) -> Result<(), QueueError>

Submit a completion item of type C across the completion subqueue.

source

pub fn get_completion( &self, flags: ReceiveFlags, ) -> Result<(u32, C), QueueError>

Receive a completion item and id from the completion subqueue.

source

pub fn setup_read_com_sleep(&self) -> ThreadSyncSleep

Setup a sleep operation for reading the completion subqueue.

source

pub fn setup_read_sub_sleep(&self) -> ThreadSyncSleep

Setup a sleep operation for reading the sending subqueue.

source

pub fn setup_write_sub_sleep(&self) -> ThreadSyncSleep

Setup a sleep operation for writing the sending subqueue.

source

pub fn setup_write_com_sleep(&self) -> ThreadSyncSleep

Setup a sleep operation for writing the completion subqueue.

Trait Implementations§

source§

impl<S: Copy, C: Copy> From<Object<QueueBase<S, C>>> for Queue<S, C>

source§

fn from(x: Object<QueueBase<S, C>>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<S, C> !Freeze for Queue<S, C>

§

impl<S, C> !ObjSafe for Queue<S, C>

§

impl<S, C> !RefUnwindSafe for Queue<S, C>

§

impl<S, C> Send for Queue<S, C>
where S: Send, C: Send,

§

impl<S, C> Sync for Queue<S, C>
where S: Send + Sync, C: Send + Sync,

§

impl<S, C> Unpin for Queue<S, C>
where S: Unpin, C: Unpin,

§

impl<S, C> UnwindSafe for Queue<S, C>

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.