pub struct ConstantCurveDto {
pub min_rate: Option<f64>,
pub max_rate: Option<f64>,
pub price: f64,
}
Expand description
A DTO to ensure that we always validate when we deserialize from an untrusted source
Fields§
§min_rate: Option<f64>
The minimum rate (nonpositive), defaulting to negative infinity if None
max_rate: Option<f64>
The maximum rate (nonnegative), defaulting to positive infinity if None
price: f64
The (finite) price
Trait Implementations§
Source§impl Debug for ConstantCurveDto
impl Debug for ConstantCurveDto
Source§impl Into<ConstantCurveDto> for ConstantCurve
impl Into<ConstantCurveDto> for ConstantCurve
Source§fn into(self) -> ConstantCurveDto
fn into(self) -> ConstantCurveDto
Converts this type into the (usually inferred) input type.
Source§impl TryFrom<ConstantCurveDto> for ConstantCurve
impl TryFrom<ConstantCurveDto> for ConstantCurve
Source§type Error = ConstantCurveError
type Error = ConstantCurveError
The type returned in the event of a conversion error.
Source§impl TryFrom<ConstantCurveDto> for DemandCurve
impl TryFrom<ConstantCurveDto> for DemandCurve
Source§type Error = ConstantCurveError
type Error = ConstantCurveError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for ConstantCurveDto
impl RefUnwindSafe for ConstantCurveDto
impl Send for ConstantCurveDto
impl Sync for ConstantCurveDto
impl Unpin for ConstantCurveDto
impl UnwindSafe for ConstantCurveDto
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more