pub trait GradientCollection {
// Required methods
fn get_gradient<D: Dimension>(
&self,
key: &str,
) -> Result<ArrayView<'_, f64, D>, ModelError>;
fn set_gradient<D: Dimension>(
&mut self,
key: &str,
value: ArrayView<'_, f64, D>,
) -> Result<(), ModelError>;
}Required Methods§
Sourcefn get_gradient<D: Dimension>(
&self,
key: &str,
) -> Result<ArrayView<'_, f64, D>, ModelError>
fn get_gradient<D: Dimension>( &self, key: &str, ) -> Result<ArrayView<'_, f64, D>, ModelError>
Get a reference to a specific gradient with strong typing.
Sourcefn set_gradient<D: Dimension>(
&mut self,
key: &str,
value: ArrayView<'_, f64, D>,
) -> Result<(), ModelError>
fn set_gradient<D: Dimension>( &mut self, key: &str, value: ArrayView<'_, f64, D>, ) -> Result<(), ModelError>
Set the value of a gradient.
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.