[−][src]Struct ryu::Buffer
Safe API for formatting floating point numbers to text.
Example
let mut buffer = ryu::Buffer::new(); let printed = buffer.format(1.234); assert_eq!(printed, "1.234");
Methods
impl Buffer
[src]
pub fn new() -> Self
[src]
This is a cheap operation; you don't need to worry about reusing buffers for efficiency.
pub fn format<F: Float>(&mut self, f: F) -> &str
[src]
Print a floating point number into this buffer and return a reference to its string representation within the buffer.
Special cases
This function does not check for NaN or infinity. If the input number is not a finite float, the printed representation will be some correctly formatted but unspecified numerical value.
Please check is_finite
yourself before calling this function, or
check is_nan
and is_infinite
and handle those cases yourself.
Trait Implementations
impl Copy for Buffer
[src]
impl Clone for Buffer
[src]
fn clone(&self) -> Buffer
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Buffer
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom for T where
T: From<U>,
[src]
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> From for T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,