pub struct ContextStore {
pub global: GlobalContext,
pub workers: HashMap<WorkerId, WorkerContext>,
pub managers: HashMap<ManagerId, ManagerContext>,
pub escalations: Vec<(WorkerId, Escalation)>,
pub actions: Option<ActionsConfig>,
pub metadata: HashMap<String, Value>,
}Expand description
正規化されたコンテキストデータストア
全ての情報を一箇所に集約し、View によって可視範囲を制御する。
Fields§
§global: GlobalContextGlobal情報(tick, progress等)
workers: HashMap<WorkerId, WorkerContext>全Worker状態
managers: HashMap<ManagerId, ManagerContext>全Manager情報
escalations: Vec<(WorkerId, Escalation)>Escalation一覧
actions: Option<ActionsConfig>利用可能Actions
metadata: HashMap<String, Value>拡張メタデータ
Implementations§
Source§impl ContextStore
impl ContextStore
Sourcepub fn new(tick: u64) -> ContextStore
pub fn new(tick: u64) -> ContextStore
新しい ContextStore を作成
Sourcepub fn with_worker(self, ctx: WorkerContext) -> ContextStore
pub fn with_worker(self, ctx: WorkerContext) -> ContextStore
Worker を追加
Sourcepub fn with_manager(self, ctx: ManagerContext) -> ContextStore
pub fn with_manager(self, ctx: ManagerContext) -> ContextStore
Manager を追加
Sourcepub fn with_escalation(
self,
worker_id: WorkerId,
escalation: Escalation,
) -> ContextStore
pub fn with_escalation( self, worker_id: WorkerId, escalation: Escalation, ) -> ContextStore
Escalation を追加
Sourcepub fn with_actions(self, actions: ActionsConfig) -> ContextStore
pub fn with_actions(self, actions: ActionsConfig) -> ContextStore
Actions を設定
Sourcepub fn insert<V>(self, key: impl Into<String>, value: V) -> ContextStore
pub fn insert<V>(self, key: impl Into<String>, value: V) -> ContextStore
メタデータを追加
Trait Implementations§
Source§impl Clone for ContextStore
impl Clone for ContextStore
Source§fn clone(&self) -> ContextStore
fn clone(&self) -> ContextStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ContextStore
impl RefUnwindSafe for ContextStore
impl Send for ContextStore
impl Sync for ContextStore
impl Unpin for ContextStore
impl UnwindSafe for ContextStore
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