pub struct CompletionQueue { /* private fields */ }Expand description
Implementations§
Source§impl CompletionQueue
impl CompletionQueue
Sourcepub fn create(
context: &Context,
min_capacity: u32,
) -> IbvResult<CompletionQueue>
pub fn create( context: &Context, min_capacity: u32, ) -> IbvResult<CompletionQueue>
Creates a new Completion Queue.
§Arguments
context— The device context on which to create the CQ.min_capacity— The minimum number of completion entries this CQ must hold. The hardware may allocate a larger queue.
§Errors
- Returns
IbvError::InvalidInputifmin_capacityis too large (exceeds device limits) or cannot fit in ani32. - Returns
IbvError::Resourceif the system cannot allocate the necessary resources.
Sourcepub fn poll<'poll_buff>(
&self,
completions: &'poll_buff mut [PollSlot],
) -> IbvResult<PolledCompletions<'poll_buff>>
pub fn poll<'poll_buff>( &self, completions: &'poll_buff mut [PollSlot], ) -> IbvResult<PolledCompletions<'poll_buff>>
Polls the CQ for completed work requests.
This method checks the hardware queue for completions. It is non-blocking: if no completions are available, it returns an empty iterator immediately.
§Arguments
completions— A mutable slice ofPollSlots. This buffer serves as the destination where the NIC/driver will write the completion data. By requiring the caller to provide this buffer, the library avoids internal heap allocations during the hot polling loop. If the buffer length exceedsi32::MAX, onlyi32::MAXentries will be polled and the remaining slots will be unused; a warning is logged in that case.
§Returns
Returns a PolledCompletions iterator wrapper. This iterator yields owned
WorkCompletion values constructed from the
data copied by the NIC into the provided completions buffer.
Sourcepub fn min_capacity(&self) -> u32
pub fn min_capacity(&self) -> u32
Returns the minimum capacity of the Completion Queue.
Trait Implementations§
Source§impl Clone for CompletionQueue
impl Clone for CompletionQueue
Source§fn clone(&self) -> CompletionQueue
fn clone(&self) -> CompletionQueue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompletionQueue
impl RefUnwindSafe for CompletionQueue
impl Send for CompletionQueue
impl Sync for CompletionQueue
impl Unpin for CompletionQueue
impl UnsafeUnpin for CompletionQueue
impl UnwindSafe for CompletionQueue
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