Struct ryu::Buffer
[−]
[src]
pub struct Buffer { /* fields omitted */ }
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]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more