pub struct MatrixHookHandle(/* private fields */);Expand description
Wrapper around Arc<dyn MatrixHook> for ergonomic use in the engine.
Cloneable, shareable, optional.
Implementations§
Source§impl MatrixHookHandle
impl MatrixHookHandle
Sourcepub fn new(hook: impl MatrixHook + 'static) -> Self
pub fn new(hook: impl MatrixHook + 'static) -> Self
Create a new handle wrapping a hook implementation.
Sourcepub fn on_converge(
&self,
node_name: &str,
actual_contribution: f64,
surprise: f64,
quality: f64,
)
pub fn on_converge( &self, node_name: &str, actual_contribution: f64, surprise: f64, quality: f64, )
Delegate to the inner hook.
Sourcepub fn route(&self, from: &str, candidates: &[String]) -> Option<Vec<String>>
pub fn route(&self, from: &str, candidates: &[String]) -> Option<Vec<String>>
Delegate routing to the inner hook.
Sourcepub fn completion(&self) -> f64
pub fn completion(&self) -> f64
Current completion estimate.
Sourcepub fn is_converged(&self) -> bool
pub fn is_converged(&self) -> bool
Whether convergence has been reached.
Sourcepub fn record_transition(&self, from: &str, to: &str, quality: f64)
pub fn record_transition(&self, from: &str, to: &str, quality: f64)
Record a transition observation.
Trait Implementations§
Source§impl Clone for MatrixHookHandle
impl Clone for MatrixHookHandle
Source§fn clone(&self) -> MatrixHookHandle
fn clone(&self) -> MatrixHookHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 !RefUnwindSafe for MatrixHookHandle
impl !UnwindSafe for MatrixHookHandle
impl Freeze for MatrixHookHandle
impl Send for MatrixHookHandle
impl Sync for MatrixHookHandle
impl Unpin for MatrixHookHandle
impl UnsafeUnpin for MatrixHookHandle
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