pub struct EventLoop<'a, S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> { /* private fields */ }Expand description
The main type, an event loop.
Implementations§
Source§impl<'a, S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> EventLoop<'a, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
impl<'a, S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> EventLoop<'a, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
Sourcepub fn new<F, Fut>(
storage: &'static LoopStorage<TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>,
selector: &'a mut Selector,
state: &'a mut RefCell<S>,
f: F,
) -> Result<Self, Error>
pub fn new<F, Fut>( storage: &'static LoopStorage<TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>, selector: &'a mut Selector, state: &'a mut RefCell<S>, f: F, ) -> Result<Self, Error>
Creates an event loop and polls given future once.
§Panics
Panics if:
storagehas already been used by another event loop- the future is bigger than
ROOT_TASK_SIZEbytes - the future is aligned to more than 16 bytes.
§Errors
Returns an error if:
- epoll/kqueue returned an error during initial poll
- given future completed during initial poll.
Trait Implementations§
Source§impl<S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> AsFd for EventLoop<'_, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
impl<S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> AsFd for EventLoop<'_, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
Source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
Source§impl<S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> AsRawFd for EventLoop<'_, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
impl<S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> AsRawFd for EventLoop<'_, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
Source§impl<S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> Debug for EventLoop<'_, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
impl<S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> Debug for EventLoop<'_, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
Auto Trait Implementations§
impl<'a, S, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> !RefUnwindSafe for EventLoop<'a, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
impl<'a, S, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> !Send for EventLoop<'a, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
impl<'a, S, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> !Sync for EventLoop<'a, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
impl<'a, S, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> !UnwindSafe for EventLoop<'a, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
impl<'a, S, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> Forget for EventLoop<'a, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
impl<'a, S, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> Freeze for EventLoop<'a, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
impl<'a, S, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> Move for EventLoop<'a, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
impl<'a, S, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> Unpin for EventLoop<'a, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>
impl<'a, S, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize> UnsafeUnpin for EventLoop<'a, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>where
Context<'a, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>: UnsafeUnpin,
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