pub trait DataSource {
// Required methods
fn names(&self) -> Vec<Spur>;
fn take_set(
&mut self,
decl: &Set,
dimen: usize,
) -> Result<Option<HashMap<SmallVec<[SetVal; 6]>, SetVals>>>;
fn take_param(&mut self, decl: &Param) -> Result<Option<ParamValues>>;
}Expand description
Provides set and param data to a model.
The compiler asks for each declared set and param in turn, passing the declaration (needed to interpret the data), and takes ownership of what’s returned.
Required Methods§
Sourcefn names(&self) -> Vec<Spur>
fn names(&self) -> Vec<Spur>
Names of all sets and params with data, so undeclared data can be rejected
fn take_set( &mut self, decl: &Set, dimen: usize, ) -> Result<Option<HashMap<SmallVec<[SetVal; 6]>, SetVals>>>
fn take_param(&mut self, decl: &Param) -> Result<Option<ParamValues>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".