[][src]Struct ryu::Buffer

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_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for Buffer[src]

Auto Trait Implementations

impl Send for Buffer

impl Sync for Buffer

Blanket Implementations

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> From for T[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]