pub struct Daemon { /* private fields */ }Implementations§
Source§impl Daemon
impl Daemon
pub const DEFAULT_MAX_WORKERS: usize = 4
pub const DEFAULT_MAX_BLOCKING: usize = pool::DAEMON_BLOCKING_THREADS
pub fn workers(self, workers: usize) -> Self
Sourcepub fn max_blocking(self, threads: usize) -> Self
pub fn max_blocking(self, threads: usize) -> Self
Bound the blocking pool at threads (at least one).
pub fn build(&self) -> Result<Runtime>
Sourcepub fn run<F: Future>(&self, main: F) -> Result<F::Output, Error>
pub fn run<F: Future>(&self, main: F) -> Result<F::Output, Error>
Build the runtime and run main on it from the calling thread —
the replacement for #[tokio::main]. The runtime shuts down when
main returns.
§Errors
Error::InsideRuntime or Error::UiThread when the caller may
not block — on the UI thread, or in any runtime context, where the
thread cannot be handed to a second runtime and tokio would panic —
and Error::Start when the runtime cannot be built.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Daemon
impl Freeze for Daemon
impl Move for Daemon
impl RefUnwindSafe for Daemon
impl Send for Daemon
impl Sync for Daemon
impl Unpin for Daemon
impl UnsafeUnpin for Daemon
impl UnwindSafe for Daemon
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more