pub struct C(pub f64);Expand description
§Provides Celsius Unit C
- Can be used to print values as string
- Can be used to convert to F and K
§Example
use tempconvert::{F, C, K}
fn main() {
let c = C(0.0);
dbg!(c);
// output
// C(0.0)
dbg!(c.to_string());
// output
// "0.0°C"
let f: F = c.into();
dbg!(f);
// output
// F(32.0)
let k: K = c.into();
dbg!(k);
// output
// K(273.0)
}Tuple Fields§
§0: f64Trait Implementations§
impl Copy for C
impl StructuralPartialEq for C
Auto Trait Implementations§
impl Freeze for C
impl RefUnwindSafe for C
impl Send for C
impl Sync for C
impl Unpin for C
impl UnsafeUnpin for C
impl UnwindSafe for C
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