pub struct Runtime<'runtime> { /* private fields */ }
Expand description
A system the manages the lifetime of threads. This includes ensuring errors are handled, threads are paused and resumed on request and that once the main application is completed, all threads complete and end.
Implementations§
Source§impl<'runtime> Runtime<'runtime>
impl<'runtime> Runtime<'runtime>
Sourcepub fn new(thread_statuses: ThreadStatuses) -> Self
pub fn new(thread_statuses: ThreadStatuses) -> Self
Create a new instances of the Runtime
.
Sourcepub fn statuses(&self) -> ThreadStatuses
pub fn statuses(&self) -> ThreadStatuses
Get a cloned copy of the ThreadStatuses
.
Sourcepub fn register(&self, threadable: &'runtime mut dyn Threadable)
pub fn register(&self, threadable: &'runtime mut dyn Threadable)
Register a new Threadable
.
Auto Trait Implementations§
impl<'runtime> Freeze for Runtime<'runtime>
impl<'runtime> !RefUnwindSafe for Runtime<'runtime>
impl<'runtime> Send for Runtime<'runtime>
impl<'runtime> Sync for Runtime<'runtime>
impl<'runtime> Unpin for Runtime<'runtime>
impl<'runtime> !UnwindSafe for Runtime<'runtime>
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