Skip to main content

MioEngine

Struct MioEngine 

Source
pub struct MioEngine { /* private fields */ }
Expand description

mio-backed Engine.

Implementations§

Source§

impl MioEngine

Source

pub fn new(pool: &BufferPool) -> Result<Self>

Creates the engine bound to the worker’s buffer pool.

§Errors

Poller creation failure.

Trait Implementations§

Source§

impl Engine for MioEngine

Source§

fn kind(&self) -> &'static str

Backend name for diagnostics (io_uring / mio).
Source§

fn add_listener(&mut self, fd: RawFd, token: Token) -> Result<()>

Registers a nonblocking listening socket for accept readiness. Read more
Source§

fn add_stream(&mut self, fd: RawFd, _token: Token) -> Result<()>

Registers a connected socket for read/write readiness. Read more
Source§

fn read(&mut self, token: Token, fd: RawFd, slot: u32) -> Result<Poll>

Queues one read into pool slot. The completion yields bytes read; 0 means EOF. Read more
Source§

fn write( &mut self, token: Token, fd: RawFd, slot: u32, len: usize, offset: usize, ) -> Result<Poll>

Queues a write of slot[0..len], resuming from a prior partial write when the backend tracks one for this token. Read more
Source§

fn connect(&mut self, token: Token, addr: SocketAddr) -> Result<(RawFd, Poll)>

Starts a nonblocking connect(2); completion is a CQE where result == Ok(0) means established. Read more
Source§

fn connect_unix(&mut self, token: Token, path: &Path) -> Result<(RawFd, Poll)>

Starts a nonblocking UDS connect(2) to path. Read more
Source§

fn accept( &mut self, lfd: RawFd, ltoken: Token, ) -> Result<Option<(RawFd, SocketAddr)>>

Attempts an accept on a registered listener; Ok(Some(..)) completes inline, Ok(None) waits for a CQE on the listener token. Read more
Source§

fn splice_pump(&mut self, a: Token, afd: i32, b: Token, bfd: i32) -> Result<()>

Starts a bidirectional zero-copy splice pump between two registered streams (IO-04). Completions on either token report bytes moved; Ok(0) signals EOF for that direction. Read more
Source§

fn remove(&mut self, fd: RawFd)

Removes a descriptor (before the worker closes it).
Source§

fn poll(&mut self, timeout: Option<Duration>, out: &mut Vec<Cqe>) -> Result<()>

Drives the backend, filling out with completions. Blocks up to timeout (or indefinitely when None). Read more
Source§

fn take_accepted(&mut self, _fd: RawFd) -> Option<SocketAddr>

Pops addresses of accepted connections reported by accept CQEs.
Source§

impl Send for MioEngine

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V