Skip to main content

DriverOps

Trait DriverOps 

Source
pub trait DriverOps: 'static {
    type Token: BackendToken;
    type ProvidedRing: ProvidedRingOps + 'static;
    type IoRequest<O: Unpin + 'static>: Future<Output = (Result<u32>, u32, O)> + Unpin + 'static;

    // Required methods
    fn buf_group(&self) -> u16;
    fn provided_ring(&mut self) -> &mut Self::ProvidedRing;
    fn arm_accept_multi(&mut self, token: Self::Token, fd: Fd) -> bool;
    fn arm_recv_multi(
        &mut self,
        token: Self::Token,
        fd: FixedFd,
        buf_group: u16,
    ) -> bool;
    unsafe fn arm_recv_msg_multi(
        &mut self,
        token: Self::Token,
        fd: FixedFd,
        buf_group: u16,
        msghdr: *const msghdr,
    ) -> bool;
    fn submit_send_tagged(
        &mut self,
        token: Self::Token,
        fd: FixedFd,
        ptr: *const u8,
        len: u32,
    ) -> bool;
    unsafe fn submit_send_msg_tagged(
        &mut self,
        token: Self::Token,
        fd: FixedFd,
        msg: *const msghdr,
    ) -> bool;
    fn cancel_recv(&mut self, token: Self::Token);
    fn try_submit_connect_raw(
        &mut self,
        fd: Fd,
        addr: SockAddr,
    ) -> Result<Self::IoRequest<SockAddr>, (Error, SockAddr)>;
    fn try_submit_sendmsg_raw<P: SendMsgPacket + Unpin + 'static>(
        &mut self,
        fd: Fd,
        packet: P,
    ) -> Result<Self::IoRequest<P>, (Error, P)>;
    fn try_submit_send_raw<B: AsRef<[u8]> + Unpin + 'static>(
        &mut self,
        fd: Fd,
        buf: B,
    ) -> Result<Self::IoRequest<B>, (Error, B)>;
}

Required Associated Types§

Source

type Token: BackendToken

Source

type ProvidedRing: ProvidedRingOps + 'static

Source

type IoRequest<O: Unpin + 'static>: Future<Output = (Result<u32>, u32, O)> + Unpin + 'static

Required Methods§

Source

fn buf_group(&self) -> u16

Source

fn provided_ring(&mut self) -> &mut Self::ProvidedRing

Source

fn arm_accept_multi(&mut self, token: Self::Token, fd: Fd) -> bool

Source

fn arm_recv_multi( &mut self, token: Self::Token, fd: FixedFd, buf_group: u16, ) -> bool

Source

unsafe fn arm_recv_msg_multi( &mut self, token: Self::Token, fd: FixedFd, buf_group: u16, msghdr: *const msghdr, ) -> bool

§Safety

msghdr must remain valid until the multishot recv is cancelled.

Source

fn submit_send_tagged( &mut self, token: Self::Token, fd: FixedFd, ptr: *const u8, len: u32, ) -> bool

Source

unsafe fn submit_send_msg_tagged( &mut self, token: Self::Token, fd: FixedFd, msg: *const msghdr, ) -> bool

§Safety

msg must remain valid until the submission completes.

Source

fn cancel_recv(&mut self, token: Self::Token)

Source

fn try_submit_connect_raw( &mut self, fd: Fd, addr: SockAddr, ) -> Result<Self::IoRequest<SockAddr>, (Error, SockAddr)>

Source

fn try_submit_sendmsg_raw<P: SendMsgPacket + Unpin + 'static>( &mut self, fd: Fd, packet: P, ) -> Result<Self::IoRequest<P>, (Error, P)>

Source

fn try_submit_send_raw<B: AsRef<[u8]> + Unpin + 'static>( &mut self, fd: Fd, buf: B, ) -> Result<Self::IoRequest<B>, (Error, B)>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§