pub struct Handle { /* private fields */ }
madsim
only.Expand description
Supervisor handle to the runtime.
Implementations
sourceimpl Handle
impl Handle
sourcepub fn seed(&self) -> u64
pub fn seed(&self) -> u64
Returns the random seed of the current runtime.
use madsim::{Config, runtime::Runtime};
let rt = Runtime::with_seed_and_config(2333, Config::default());
assert_eq!(rt.handle().seed(), 2333);
sourcepub fn kill(&self, id: NodeId)
pub fn kill(&self, id: NodeId)
Kill a node.
- All tasks spawned on this node will be killed immediately.
- All data that has not been flushed to the disk will be lost.
sourcepub fn create_node(&self) -> NodeBuilder<'_>
pub fn create_node(&self) -> NodeBuilder<'_>
Create a node which will be bound to the specified address.
sourcepub fn get_node(&self, id: NodeId) -> Option<NodeHandle>
pub fn get_node(&self, id: NodeId) -> Option<NodeHandle>
Return a handle of the specified node.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Handle
impl !Send for Handle
impl !Sync for Handle
impl Unpin for Handle
impl UnwindSafe for Handle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more