UserState

Trait UserState 

Source
pub trait UserState {
    type Float: TrellisFloat;
    type Param;

    // Required methods
    fn new() -> Self;
    fn update(&mut self) -> impl Into<Option<UpdateData<Self::Float>>>;
    fn get_param(&self) -> Option<&Self::Param>;
    fn last_was_best(&mut self);

    // Provided method
    fn is_initialised(&self) -> bool { ... }
}
Expand description

The user-defined state must implement this trait to be used as part of the trellis calculation loop

All other state methods are auto-implemented on a type wrapping the user-defined state.

Required Associated Types§

Required Methods§

Source

fn new() -> Self

Create a new instance of the user-defined state object

Source

fn update(&mut self) -> impl Into<Option<UpdateData<Self::Float>>>

Source

fn get_param(&self) -> Option<&Self::Param>

Source

fn last_was_best(&mut self)

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§