pub struct Background { /* private fields */ }Expand description
A handle to a reactor running on a background thread. This can be used to ensure that the reactor is being constantly polled without blocking another thread.
Implementations§
Source§impl Background
impl Background
Sourcepub fn new(reactor: Reactor) -> Result<Self>
pub fn new(reactor: Reactor) -> Result<Self>
Creates a new background thread which polls the given
reactor. All errors returned during the creation of
the ReactorThread will be propagated.
Sourcepub fn register<E: Evented>(
&self,
resource: &E,
interest: Ready,
opts: PollOpt,
) -> Result<Arc<IoWaker>>
pub fn register<E: Evented>( &self, resource: &E, interest: Ready, opts: PollOpt, ) -> Result<Arc<IoWaker>>
Registers a new IO resource with this reactor.
pub fn reregister<E: Evented>( &self, resource: &E, io_waker: &IoWaker, interest: Ready, opts: PollOpt, ) -> Result<()>
Sourcepub fn deregister<E: Evented>(
&self,
resource: &E,
io_waker: &IoWaker,
) -> Result<()>
pub fn deregister<E: Evented>( &self, resource: &E, io_waker: &IoWaker, ) -> Result<()>
Stops tracking notifications from the provided IO resource.
Sourcepub fn shutdown_now(&mut self) -> Result<()>
pub fn shutdown_now(&mut self) -> Result<()>
Shuts down the thread where the reactor is being polled, panicking if the reactor can not be woken up, and returning any errors which happened in the thread where the reactor was being polled.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Background
impl !RefUnwindSafe for Background
impl Send for Background
impl Sync for Background
impl Unpin for Background
impl !UnwindSafe for Background
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