pub unsafe fn pop<T>(&mut self) -> Result<Option<Cqe<T>>> {
        self.cqueue
            .pop()
            .map(|maybe_cqe| {
                maybe_cqe.map(|cqe| {
                    // This is safe since the pop-ed CQEs have been previously pushed. However
                    // we use a saturating_sub for extra safety.
                    self.num_ops = self.num_ops.saturating_sub(1);
                    cqe
                })
            })
            .map_err(Error::CQueue)
    }
/// Pop a completed entry off the completion queue. Returns `Ok(None)` if there are no entries.
/// The type `T` must be the same as the `user_data` type used for `push`-ing the operation.
///
/// # Safety
/// Unsafe because we reconstruct the `user_data` from a raw pointer passed by the kernel.
/// It's up to the caller to make sure that `T` is the correct type of the `user_data`, that
/// the raw pointer is valid and that we have full ownership of that address.
Pop a completed entry off the completion queue. Returns `Ok(None)` if there are no entries.
Pop a completed entry off the completion queue . Returns ` Ok ( None ) ` if there are no entries .
pub unsafe fn pop<T>(&mut self) -> Result<Option<Cqe<T>>> {
        self.cqueue
            .pop()
            .map(|maybe_cqe| {
                maybe_cqe.map(|cqe| {
                    // This is safe since the pop-ed CQEs have been previously pushed. However
                    // we use a saturating_sub for extra safety.
                    self.num_ops = self.num_ops.saturating_sub(1);
                    cqe
                })
            })
            .map_err(Error::CQueue)
    }
pub unsafe fn pop < T > ( & mut self ) -> Result < Option < Cqe < T > > > { self . cqueue . pop ( ) . map ( | maybe_cqe | { maybe_cqe . map ( | cqe | { // This is safe since the pop-ed CQEs have been previously pushed. However // we use a saturating_sub for extra safety. self . num_ops = self . num_ops . saturating_sub ( 1 ) ; cqe } ) } ) . map_err ( Error :: CQueue ) }
Pop a completed entry off the completion queue.
Pop a completed entry off the completion queue .
&mut self
&mut self
safety
Unsafe because we reconstruct the `user_data` from a raw pointer passed by the kernel.
It's up to the caller to make sure that `T` is the correct type of the `user_data`, that
the raw pointer is valid and that we have full ownership of that address.
Unsafe because we reconstruct the ` user_data ` from a raw pointer passed by the kernel . It ' s up to the caller to make sure that ` T ` is the correct type of the ` user_data ` that the raw pointer is valid and that we have full ownership of that address .