pub struct TemperatureOffset(/* private fields */);
Expand description
A runtime checked representation of the forced recalibration value. Accepted value range: [0.0…6553.5] °C.
Implementations§
Source§impl TemperatureOffset
impl TemperatureOffset
Sourcepub const fn to_be_bytes(&self) -> [u8; 2]
pub const fn to_be_bytes(&self) -> [u8; 2]
Returns a big endian byte representation of the temperature offset.
Trait Implementations§
Source§impl Debug for TemperatureOffset
impl Debug for TemperatureOffset
Source§impl PartialEq for TemperatureOffset
impl PartialEq for TemperatureOffset
Source§impl TryFrom<&[u8]> for TemperatureOffset
impl TryFrom<&[u8]> for TemperatureOffset
Source§fn try_from(data: &[u8]) -> Result<Self, Self::Error>
fn try_from(data: &[u8]) -> Result<Self, Self::Error>
Converts buffered data to a TemperatureOffset value.
§Errors
- ReceivedBufferWrongSize if the
data
buffer is not big enough for the data that should have been received. - CrcFailed if the CRC of the received data does not match.
Source§impl TryFrom<f32> for TemperatureOffset
impl TryFrom<f32> for TemperatureOffset
Source§fn try_from(offset: f32) -> Result<Self, Self::Error>
fn try_from(offset: f32) -> Result<Self, Self::Error>
Converts a f32 value to a TemperatureOffset. The value must be between 0.0 and 6553.5 in °C.
§Errors
- ValueOutOfRange if
offset
is lower than 0.0 or higher than 6553.5 °C.
Source§impl TryFrom<f64> for TemperatureOffset
impl TryFrom<f64> for TemperatureOffset
Source§fn try_from(offset: f64) -> Result<Self, Self::Error>
fn try_from(offset: f64) -> Result<Self, Self::Error>
Converts a f64 value to a TemperatureOffset. The value must be between 0.0 and 6553.5 in °C.
§Errors
- ValueOutOfRange if
offset
is lower than 0.0 or higher than 6553.5 °C.
impl StructuralPartialEq for TemperatureOffset
Auto Trait Implementations§
impl Freeze for TemperatureOffset
impl RefUnwindSafe for TemperatureOffset
impl Send for TemperatureOffset
impl Sync for TemperatureOffset
impl Unpin for TemperatureOffset
impl UnwindSafe for TemperatureOffset
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