pub struct WriteTo<'a> { /* private fields */ }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§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for WriteTo<'a>
impl<'a> RefUnwindSafe for WriteTo<'a>
impl<'a> Send for WriteTo<'a>
impl<'a> Sync for WriteTo<'a>
impl<'a> Unpin for WriteTo<'a>
impl<'a> !UnwindSafe for WriteTo<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more