pub trait ParamLaw:
Debug
+ Send
+ Sync {
// Required methods
fn to_physical(&self, stored: f64) -> Result<f64, RangeError>;
fn to_stored(&self, physical: f64) -> Result<f64, RangeError>;
}Expand description
A law between the stored value of a control and its physical value.
Both directions use the base number of the unit type: hertz, seconds, percent from 0 to 100, decibels. A law is strictly monotone over its domain and never rounds.
Required Methods§
Sourcefn to_physical(&self, stored: f64) -> Result<f64, RangeError>
fn to_physical(&self, stored: f64) -> Result<f64, RangeError>
The physical value of a stored value.
§Errors
A RangeError when the stored value is outside the domain of the
law or the result is not finite.
Sourcefn to_stored(&self, physical: f64) -> Result<f64, RangeError>
fn to_stored(&self, physical: f64) -> Result<f64, RangeError>
The stored value of a physical value.
§Errors
A RangeError when the physical value has no stored value under
the law or the result is not finite.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".