pub struct Remote { /* private fields */ }
Expand description
Handle to an event loop, used to construct I/O objects, send messages, and otherwise interact indirectly with the event loop itself.
Handles can be cloned, and when cloned they will still refer to the same underlying event loop.
Implementations§
Source§impl Remote
impl Remote
Sourcepub fn spawn<F, R>(&self, f: F)
pub fn spawn<F, R>(&self, f: F)
Spawns a new future into the event loop this remote is associated with.
This function takes a closure which is executed within the context of the I/O loop itself. The future returned by the closure will be scheduled on the event loop an run to completion.
Note that while the closure, F, requires the Send bound as it might cross threads, the future R does not.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Remote
impl !RefUnwindSafe for Remote
impl Send for Remote
impl Sync for Remote
impl Unpin for Remote
impl !UnwindSafe for Remote
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