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§
type Float: TrellisFloat
type Param
Required Methods§
fn update(&mut self) -> impl Into<Option<UpdateData<Self::Float>>>
fn get_param(&self) -> Option<&Self::Param>
fn last_was_best(&mut self)
Provided Methods§
fn is_initialised(&self) -> bool
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.