pub struct Format<'a, T>(pub &'a mut Buffer, pub T);Expand description
Const & safe API for formatting floating point numbers to text.
§Example
let mut buffer = const_ryu::Buffer::new();
let printed = const_ryu::Format(&mut buffer, 1.234f32).call_once();
assert_eq!(printed, "1.234");
let printed = const_ryu::Format(&mut buffer, 1.234f64).call_once();
assert_eq!(printed, "1.234");
let printed = const_ryu::Format(&mut buffer, f64::NAN).call_once();
assert_eq!(printed, "NaN");Tuple Fields§
§0: &'a mut Buffer§1: TImplementations§
Auto Trait Implementations§
impl<'a, T> Freeze for Format<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for Format<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for Format<'a, T>where
T: Send,
impl<'a, T> Sync for Format<'a, T>where
T: Sync,
impl<'a, T> Unpin for Format<'a, T>where
T: Unpin,
impl<'a, T> !UnwindSafe for Format<'a, T>
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