pub struct Writable<A: Array<Item = u8>>(/* private fields */);Expand description
Newtype wrapper that adds a blanket implementation of core::fmt::Write
to any & all Arrays
This allows alloc-less format strings:
use core::fmt::Write;
use toad_array::Array;
use toad_writable::Writable;
let mut stringish = Writable::from(vec![]);
write!(stringish, "Your number is: {}", 123).ok();
assert_eq!(stringish.as_str(), "Your number is: 123");Implementations§
Trait Implementations§
Source§impl<A: Array<Item = u8>> Write for Writable<A>
impl<A: Array<Item = u8>> Write for Writable<A>
impl<A: Copy + Array<Item = u8>> Copy for Writable<A>
Auto Trait Implementations§
impl<A> Freeze for Writable<A>where
A: Freeze,
impl<A> RefUnwindSafe for Writable<A>where
A: RefUnwindSafe,
impl<A> Send for Writable<A>where
A: Send,
impl<A> Sync for Writable<A>where
A: Sync,
impl<A> Unpin for Writable<A>where
A: Unpin,
impl<A> UnwindSafe for Writable<A>where
A: UnwindSafe,
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