Struct itoa::Buffer

source ·
pub struct Buffer { /* private fields */ }
Expand description

A correctly sized stack allocation for the formatted integer to be written into.

Example

let mut buffer = itoa::Buffer::new();
let printed = buffer.format(1234);
assert_eq!(printed, "1234");

Implementations§

This is a cheap operation; you don’t need to worry about reusing buffers for efficiency.

Examples found in repository?
src/lib.rs (line 66)
65
66
67
68
69
70
71
72
73
74
    fn default() -> Buffer {
        Buffer::new()
    }
}

impl Clone for Buffer {
    #[inline]
    fn clone(&self) -> Self {
        Buffer::new()
    }

Print an integer into this buffer and return a reference to its string representation within the buffer.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.