pub struct System { /* private fields */ }Expand description
System is a runtime manager.
Implementations§
Source§impl System
impl System
Sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Build a new system with a customized tokio runtime.
This allows to customize the runtime. See struct level docs on
Builder for more information.
Sourcepub fn new<T: Into<String>>(name: T) -> SystemRunner
pub fn new<T: Into<String>>(name: T) -> SystemRunner
Create new system.
This method panics if it can not create tokio runtime
Sourcepub fn run_in_tokio<T: Into<String>>(
name: T,
local: &LocalSet,
) -> impl Future<Output = Result<()>>
pub fn run_in_tokio<T: Into<String>>( name: T, local: &LocalSet, ) -> impl Future<Output = Result<()>>
Create new system using provided tokio Handle.
This method panics if it can not spawn system arbiter
Sourcepub fn with_current<F, R>(f: F) -> R
pub fn with_current<F, R>(f: F) -> R
Execute function with system reference.
Sourcepub fn stop_with_code(&self, code: i32)
pub fn stop_with_code(&self, code: i32)
Stop the system with a particular exit code.
Sourcepub fn stop_on_panic(&self) -> bool
pub fn stop_on_panic(&self) -> bool
Return status of ‘stop_on_panic’ option which controls whether the System is stopped when an uncaught panic is thrown from a worker thread.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for System
impl !RefUnwindSafe for System
impl Send for System
impl Sync for System
impl Unpin for System
impl !UnwindSafe for System
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