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>
impl<S: Copy, C: Copy> Queue<S, C>
sourcepub fn object(&self) -> &Object<QueueBase<S, C>>
pub fn object(&self) -> &Object<QueueBase<S, C>>
Get a handle to the internal object that holds the queue data.
sourcepub fn create(
create_spec: &CreateSpec,
sub_queue_len: usize,
com_queue_len: usize,
) -> Result<Self, CreateError>
pub fn create( create_spec: &CreateSpec, sub_queue_len: usize, com_queue_len: usize, ) -> Result<Self, CreateError>
Create a new Twizzler queue object.
sourcepub fn submit(
&self,
id: u32,
item: S,
flags: SubmissionFlags,
) -> Result<(), QueueError>
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.
sourcepub fn receive(&self, flags: ReceiveFlags) -> Result<(u32, S), QueueError>
pub fn receive(&self, flags: ReceiveFlags) -> Result<(u32, S), QueueError>
Receive an item and request id from the sending subqueue.
sourcepub fn complete(
&self,
id: u32,
item: C,
flags: SubmissionFlags,
) -> Result<(), QueueError>
pub fn complete( &self, id: u32, item: C, flags: SubmissionFlags, ) -> Result<(), QueueError>
Submit a completion item of type C across the completion subqueue.
sourcepub fn get_completion(
&self,
flags: ReceiveFlags,
) -> Result<(u32, C), QueueError>
pub fn get_completion( &self, flags: ReceiveFlags, ) -> Result<(u32, C), QueueError>
Receive a completion item and id from the completion subqueue.
sourcepub fn setup_read_com_sleep(&self) -> ThreadSyncSleep
pub fn setup_read_com_sleep(&self) -> ThreadSyncSleep
Setup a sleep operation for reading the completion subqueue.
sourcepub fn setup_read_sub_sleep(&self) -> ThreadSyncSleep
pub fn setup_read_sub_sleep(&self) -> ThreadSyncSleep
Setup a sleep operation for reading the sending subqueue.
sourcepub fn setup_write_sub_sleep(&self) -> ThreadSyncSleep
pub fn setup_write_sub_sleep(&self) -> ThreadSyncSleep
Setup a sleep operation for writing the sending subqueue.
sourcepub fn setup_write_com_sleep(&self) -> ThreadSyncSleep
pub fn setup_write_com_sleep(&self) -> ThreadSyncSleep
Setup a sleep operation for writing the completion subqueue.
Trait Implementations§
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>
impl<S, C> Sync for Queue<S, C>
impl<S, C> Unpin for Queue<S, C>
impl<S, C> UnwindSafe for Queue<S, C>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more