pub struct Lio { /* private fields */ }Implementations§
Source§impl Lio
impl Lio
Sourcepub fn new_with_backend<D>(backend: D, cap: usize) -> Result<Self>where
D: IoBackend + 'static,
pub fn new_with_backend<D>(backend: D, cap: usize) -> Result<Self>where
D: IoBackend + 'static,
Creates a new Lio driver with the specified backend and capacity.
§Arguments
backend- The I/O backend implementation (e.g., io_uring, epoll/kqueue)cap- The maximum number of concurrent operations
§Example
use lio::Lio;
use lio::backends::pollingv2::Poller;
let mut lio = Lio::new_with_backend(Poller::new(), 1024).unwrap();Sourcepub fn try_run(&self) -> Result<usize>
pub fn try_run(&self) -> Result<usize>
Non-blocking poll for completed operations.
Returns immediately, processing any completions that are ready.
Sourcepub fn run_timeout(&self, timeout: Duration) -> Result<usize>
pub fn run_timeout(&self, timeout: Duration) -> Result<usize>
Run the event loop with a timeout.
Waits for at least one operation to complete or until the timeout expires,
whichever comes first. Returns Ok(true) if completions were processed,
Ok(false) if the timeout expired with no completions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Lio
impl !RefUnwindSafe for Lio
impl !Send for Lio
impl !Sync for Lio
impl Unpin for Lio
impl UnsafeUnpin for Lio
impl !UnwindSafe for Lio
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