pub struct TaskServer {
ctrl: Control,
cancel_tx: Sender<bool>,
}
Expand description
タスクサーバ本体。
Fields§
§ctrl: Control
各タスクに clone して渡すオリジナルの Control。
cancel_tx: Sender<bool>
システムシャットダウン時の中断リクエストの送信側。 https://tokio.rs/tokio/topics/shutdown “Telling things to shut down” + “Waiting for things to finish shutting down”
Implementations§
Source§impl TaskServer
impl TaskServer
Sourcepub fn new(sysmods: SystemModules) -> Self
pub fn new(sysmods: SystemModules) -> Self
タスクサーバを生成して初期化する。
Sourcepub fn spawn_oneshot_task<F, T>(&self, name: &str, f: F)
pub fn spawn_oneshot_task<F, T>(&self, name: &str, f: F)
spawn_oneshot_task を内蔵の Self::ctrl を使って呼び出す。
Auto Trait Implementations§
impl Freeze for TaskServer
impl !RefUnwindSafe for TaskServer
impl Send for TaskServer
impl Sync for TaskServer
impl Unpin for TaskServer
impl !UnwindSafe for TaskServer
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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