pub struct Arbiter { /* private fields */ }Expand description
An arbiter is a single-threaded event loop, allowing users to spawn tasks onto it.
Implementations§
Source§impl Arbiter
impl Arbiter
Sourcepub fn current() -> ArbiterHandle
pub fn current() -> ArbiterHandle
Get a handle to the arbiter that the current task is running in.
If the arbiter is not available, this function panics. If you don’t want a panic, use
Self::try_current, which returns an Option<ArbiterHandle>.
Sourcepub fn try_current() -> Option<ArbiterHandle>
pub fn try_current() -> Option<ArbiterHandle>
Get a handle to the arbiter that the current task is running in.
If the arbiter is not available, this returns None.
Sourcepub fn handle(&self) -> &ArbiterHandle
pub fn handle(&self) -> &ArbiterHandle
Get a handle to this arbiter.
pub fn new() -> Self
pub fn with_tokio_rt(factory: impl Fn() -> Runtime + Send + 'static) -> Self
pub fn join(self) -> Result<()>
Methods from Deref<Target = ArbiterHandle>§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Arbiter
impl !RefUnwindSafe for Arbiter
impl Send for Arbiter
impl Sync for Arbiter
impl Unpin for Arbiter
impl !UnwindSafe for Arbiter
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