pub struct Temperature(/* private fields */);Expand description
Valid model temperature in the inclusive range 0.0..=2.0.
Implementations§
Source§impl Temperature
impl Temperature
Sourcepub fn new(value: f64) -> Result<Self, Error>
pub fn new(value: f64) -> Result<Self, Error>
Creates a validated temperature.
Apple Intelligence accepts temperatures in the inclusive range
Temperature::MIN through Temperature::MAX. Lower values make
output more deterministic; higher values make output more varied.
§Examples
use aimx::Temperature;
let temperature = Temperature::new(0.2)?;
assert_eq!(temperature.as_f64(), 0.2);§Errors
Returns Error::InvalidTemperature when value is outside
0.0..=2.0 or is NaN.
Trait Implementations§
Source§impl Clone for Temperature
impl Clone for Temperature
Source§fn clone(&self) -> Temperature
fn clone(&self) -> Temperature
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Temperature
impl Debug for Temperature
Source§impl PartialEq for Temperature
impl PartialEq for Temperature
Source§impl TryFrom<f64> for Temperature
impl TryFrom<f64> for Temperature
impl Copy for Temperature
impl StructuralPartialEq for Temperature
Auto Trait Implementations§
impl Freeze for Temperature
impl RefUnwindSafe for Temperature
impl Send for Temperature
impl Sync for Temperature
impl Unpin for Temperature
impl UnsafeUnpin for Temperature
impl UnwindSafe for Temperature
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