pub struct ObserverSet { /* private fields */ }Expand description
Ordered post-step observer fan-out.
Implementations§
Source§impl ObserverSet
impl ObserverSet
Sourcepub fn new(
expected_plan: Digest,
tensor: TensorSpec,
max_steps: u32,
observers: Vec<Box<dyn StepObserver>>,
) -> Result<Self>
pub fn new( expected_plan: Digest, tensor: TensorSpec, max_steps: u32, observers: Vec<Box<dyn StepObserver>>, ) -> Result<Self>
Creates an ordered observer set bound to one plan and tensor.
§Errors
Returns an error for an empty or oversized set or zero step bound.
Sourcepub fn observe(
&mut self,
context: &StepContext,
state: &[f32],
) -> Result<ControlFlow>
pub fn observe( &mut self, context: &StepContext, state: &[f32], ) -> Result<ControlFlow>
Delivers one immutable committed post-step state in declared order.
All observers receive the boundary even when an earlier observer asks to stop. A callback error or panic is contained and terminates fan-out.
§Errors
Returns a compatibility, bound, callback, panic, or finite-value error.
Sourcepub fn receipts(&self) -> &[ObserverReceipt]
pub fn receipts(&self) -> &[ObserverReceipt]
Returns current accounting in observer order.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ObserverSet
impl !Send for ObserverSet
impl !Sync for ObserverSet
impl !UnwindSafe for ObserverSet
impl Freeze for ObserverSet
impl Unpin for ObserverSet
impl UnsafeUnpin for ObserverSet
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