Struct stackfmt::WriteTo[][src]

pub struct WriteTo<'a> { /* fields omitted */ }
Expand description

Impl of core::fmt::Write stream that writes formatted string into provided u8 buffer.

use core::fmt;

let mut buffer = [0u8; 16];
let mut w = stackfmt::WriteTo::new(&mut buffer);
match fmt::write(&mut w, format_args!("The answer is {}", 42)) {
   Ok(_) => w.as_str(),
   Err(_) => "",
};
assert_eq!(buffer, "The answer is 42".as_bytes());

Implementations

Creates new stream.

How many bytes were written into the buffer

Returns buffer view as &str

Trait Implementations

Writes a string slice into this writer, returning whether the write succeeded. Read more

Writes a char into this writer, returning whether the write succeeded. Read more

Glue for usage of the write! macro with implementors of this trait. 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

Performs the conversion.

Performs the conversion.

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.