Skip to main content

DynHydroModel

Trait DynHydroModel 

Source
pub trait DynHydroModel: Send {
    // Required methods
    fn step(&mut self, forcing: &Forcing, dt_h: f64);
    fn discharge(&self) -> f64;
    fn name(&self) -> &'static str;
    fn params_json(&self) -> Value;
    fn set_params_json(&mut self, v: &Value);
    fn reset(&mut self);
}
Expand description

Object-safe wrapper so the platform can hold Vec<Box<dyn DynHydroModel>> for heterogeneous multi-model comparison.

Required Methods§

Source

fn step(&mut self, forcing: &Forcing, dt_h: f64)

Source

fn discharge(&self) -> f64

Source

fn name(&self) -> &'static str

Source

fn params_json(&self) -> Value

Source

fn set_params_json(&mut self, v: &Value)

Source

fn reset(&mut self)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<M: HydroModel> DynHydroModel for M

Blanket impl: any HydroModel is automatically a DynHydroModel.