pub struct Celsius(pub i32);Expand description
Temperature wrapper for type-safety.
Unit: Centigrade * 100.
§Example
Celsius(2350) represents 23.50 °C.
Tuple Fields§
§0: i32Implementations§
Source§impl Celsius
impl Celsius
Sourcepub fn split(&self) -> (i32, i32)
pub fn split(&self) -> (i32, i32)
Splits the fixed-point value into integral (degrees) and fractional (decimals) parts.
Useful for logging or displaying data without converting to f32.
§Returns
A tuple (whole, fraction).
§Example
use bme680_driver::Celsius;
let temp = Celsius(2350);
assert_eq!(temp.split(), (23, 50)); // Represents 23.50 °CTrait Implementations§
impl Copy for Celsius
Auto Trait Implementations§
impl Freeze for Celsius
impl RefUnwindSafe for Celsius
impl Send for Celsius
impl Sync for Celsius
impl Unpin for Celsius
impl UnwindSafe for Celsius
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