pub struct Controller {
pub rt: Runtime,
sysmods: SystemModules,
cancel_rx: Mutex<Option<Receiver<bool>>>,
}
Expand description
TaskServer と各非同期タスク間で共有されるデータ。
インスタンスは1つだけ生成され、Arc により共有される。
Fields§
§rt: Runtime
Tokio ランタイム。
sysmods: SystemModules
全システムモジュールのリスト。
cancel_rx: Mutex<Option<Receiver<bool>>>
システムシャットダウン時、true が設定送信される。
また、シャットダウンシーケンスにおいて、全タスクの完了待ちのためにも使う。 サーバ側は clone されたこれがすべて drop されるまで待機する。
Implementations§
Source§impl Controller
impl Controller
Sourcepub fn sysmods(&self) -> &SystemModules
pub fn sysmods(&self) -> &SystemModules
crate::sysmod::SystemModule リストへの参照を取得する。
Sourcepub async fn wait_cancel_rx(&self)
pub async fn wait_cancel_rx(&self)
キャンセル通知を待つ。
Auto Trait Implementations§
impl !Freeze for Controller
impl !RefUnwindSafe for Controller
impl Send for Controller
impl Sync for Controller
impl Unpin for Controller
impl !UnwindSafe for Controller
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