[][src]Struct iou::SubmissionQueueEvent

pub struct SubmissionQueueEvent<'a> { /* fields omitted */ }

A pending IO event.

Can be configured with a set of SubmissionFlags.

Implementations

impl<'a> SubmissionQueueEvent<'a>[src]

pub fn user_data(&self) -> u64[src]

Get this event's user data.

pub fn set_user_data(&mut self, user_data: u64)[src]

Set this event's user data. User data is intended to be used by the application after completion.

sq_event.set_user_data(0xB00);
ring.submit_sqes()?;

let cq_event = ring.wait_for_cqe()?;
assert_eq!(cq_event.user_data(), 0xB00);

pub fn flags(&self) -> SubmissionFlags[src]

Get this event's flags.

pub fn set_flags(&mut self, flags: SubmissionFlags)[src]

Set this event's flags.

pub unsafe fn prep_read(&mut self, fd: RawFd, buf: &mut [u8], offset: usize)[src]

pub unsafe fn prep_read_vectored(
    &mut self,
    fd: RawFd,
    bufs: &mut [IoSliceMut],
    offset: usize
)
[src]

pub unsafe fn prep_read_fixed(
    &mut self,
    fd: RawFd,
    buf: &mut [u8],
    offset: usize,
    buf_index: usize
)
[src]

pub unsafe fn prep_write(&mut self, fd: RawFd, buf: &[u8], offset: usize)[src]

pub unsafe fn prep_write_vectored(
    &mut self,
    fd: RawFd,
    bufs: &[IoSlice],
    offset: usize
)
[src]

pub unsafe fn prep_write_fixed(
    &mut self,
    fd: RawFd,
    buf: &[u8],
    offset: usize,
    buf_index: usize
)
[src]

pub unsafe fn prep_fsync(&mut self, fd: RawFd, flags: FsyncFlags)[src]

pub unsafe fn prep_timeout(&mut self, ts: &__kernel_timespec)[src]

Prepare a timeout event.

// make a one-second timeout
let timeout_spec: _ = uring_sys::__kernel_timespec {
    tv_sec:  1 as _,
    tv_nsec: 0 as _,
};

unsafe { sqe.prep_timeout(&timeout_spec); }

ring.submit_sqes()?;

pub unsafe fn prep_timeout_with_flags(
    &mut self,
    ts: &__kernel_timespec,
    count: usize,
    flags: TimeoutFlags
)
[src]

pub unsafe fn prep_timeout_remove(&mut self, user_data: u64)[src]

pub unsafe fn prep_poll_add(&mut self, fd: RawFd, poll_flags: PollFlags)[src]

pub unsafe fn prep_poll_remove(&mut self, user_data: u64)[src]

pub unsafe fn prep_connect(&mut self, fd: RawFd, socket_addr: &SockAddr)[src]

pub unsafe fn prep_accept(
    &mut self,
    fd: RawFd,
    accept: Option<&mut SockAddrStorage>,
    flags: SockFlag
)
[src]

pub unsafe fn prep_nop(&mut self)[src]

Prepare a no-op event.

// example: use a no-op to force a drain

let mut nop = ring.next_sqe().unwrap();

nop.set_flags(SubmissionFlags::IO_DRAIN);
unsafe { nop.prep_nop(); }

ring.submit_sqes()?;

pub fn clear(&mut self)[src]

Clear event. Clears user data, flags, and any event setup.

sqe.set_user_data(0x1010);
sqe.set_flags(SubmissionFlags::IO_DRAIN);

sqe.clear();

assert_eq!(sqe.user_data(), 0x0);
assert_eq!(sqe.flags(), SubmissionFlags::empty());

pub fn raw(&self) -> &io_uring_sqe[src]

Get a reference to the underlying uring_sys::io_uring_sqe object.

You can use this method to inspect the low-level details of an event.

unsafe { sqe.prep_nop(); }

let sqe_ref = sqe.raw();

assert_eq!(sqe_ref.len, 0);

pub fn raw_mut(&mut self) -> &mut io_uring_sqe[src]

Trait Implementations

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.