pub struct CompletionQueue<'ctx> { /* private fields */ }
Expand description

A completion queue that allows subscribing to the completion of queued sends and receives.

Implementations§

source§

impl<'ctx> CompletionQueue<'ctx>

source

pub fn poll<'c>( &self, completions: &'c mut [ibv_wc] ) -> Result<&'c mut [ibv_wc], ()>

Poll for (possibly multiple) work completions.

A Work Completion indicates that a Work Request in a Work Queue, and all of the outstanding unsignaled Work Requests that posted to that Work Queue, associated with this CQ have completed. Any Receive Requests, signaled Send Requests and Send Requests that ended with an error will generate Work Completions.

When a Work Request ends, a Work Completion is added to the tail of the CQ that this Work Queue is associated with. poll checks if Work Completions are present in a CQ, and pop them from the head of the CQ in the order they entered it (FIFO) into completions. After a Work Completion was popped from a CQ, it cannot be returned to it. poll returns the subset of completions that successfully completed. If the returned slice has fewer elements than the provided completions slice, the CQ was emptied.

Not all attributes of the completed ibv_wc’s are always valid. If the completion status is not IBV_WC_SUCCESS, only the following attributes are valid: wr_id, status, qp_num, and vendor_err.

Note that poll does not block or cause a context switch. This is why RDMA technologies can achieve very low latency (below 1 µs).

Trait Implementations§

source§

impl<'a> Drop for CompletionQueue<'a>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a> Send for CompletionQueue<'a>

source§

impl<'a> Sync for CompletionQueue<'a>

Auto Trait Implementations§

§

impl<'ctx> RefUnwindSafe for CompletionQueue<'ctx>

§

impl<'ctx> Unpin for CompletionQueue<'ctx>

§

impl<'ctx> UnwindSafe for CompletionQueue<'ctx>

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

§

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

§

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.