pub struct LearningEventChannel { /* private fields */ }Expand description
Learning Event Channel
broadcast channel で学習イベントを配信。 同期的な drain も可能(Orchestrator から使用)。
Implementations§
Source§impl LearningEventChannel
impl LearningEventChannel
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
有効かどうか
Sourcepub fn current_tick(&self) -> u64
pub fn current_tick(&self) -> u64
現在の Tick を取得
Sourcepub fn emit(&self, event: LearningEvent)
pub fn emit(&self, event: LearningEvent)
イベントを発行
enabled=true の場合のみ発行。 broadcast channel と sync_buffer の両方に追加。
Sourcepub fn drain_sync(&self) -> Vec<LearningEvent>
pub fn drain_sync(&self) -> Vec<LearningEvent>
同期的にバッファからイベントを取り出す
Orchestrator の tick 処理後に呼び出して、 LearningEvent を ActionEvent に変換して記録する。
Sourcepub fn subscribe(&self) -> Receiver<LearningEvent>
pub fn subscribe(&self) -> Receiver<LearningEvent>
Subscriber を取得
Sourcepub fn receiver_count(&self) -> usize
pub fn receiver_count(&self) -> usize
現在の Subscriber 数
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LearningEventChannel
impl RefUnwindSafe for LearningEventChannel
impl Send for LearningEventChannel
impl Sync for LearningEventChannel
impl Unpin for LearningEventChannel
impl UnwindSafe for LearningEventChannel
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> 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