pub struct Buffer<T> { /* private fields */ }
Expand description
Static buffer to hold written text.
Implementation of ToStr
must write it from the end.
Implementations§
Source§impl<S: Sized> Buffer<S>
impl<S: Sized> Buffer<S>
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Access str from underlying storage
Returns empty if nothing has been written into buffer yet.
Sourcepub fn write<T: ToStr>(&mut self, val: T) -> &str
pub fn write<T: ToStr>(&mut self, val: T) -> &str
Formats value into buffer, returning text.
Buffer remembers the write, therefore as_str()
will return the same text as last
write
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Buffer<T>where
T: Freeze,
impl<T> RefUnwindSafe for Buffer<T>where
T: RefUnwindSafe,
impl<T> Send for Buffer<T>where
T: Send,
impl<T> Sync for Buffer<T>where
T: Sync,
impl<T> Unpin for Buffer<T>where
T: Unpin,
impl<T> UnwindSafe for Buffer<T>where
T: 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