Struct WriteBuffer
pub struct WriteBuffer<const SIZE: usize> { /* private fields */ }
A buffer for construct a string while avoiding heap allocation.
The only requirement is that the buffer is large enough to hold the formatted string.
Implementations
impl<const SIZE: usize> WriteBuffer<SIZE>
const fn new() -> SelfCreates an empty buffer.
fn as_str(&self) -> &strObtain the contents of the buffer as a string.
const fn remaining_capacity(&self) -> usizeDetermine how many bytes are remaining in the buffer.
Trait Implementations
impl<const LEFT_SIZE: usize, const RIGHT_SIZE: usize> PartialEq<WriteBuffer<RIGHT_SIZE>> for WriteBuffer<LEFT_SIZE>
fn eq(&self, other: &WriteBuffer<RIGHT_SIZE>) -> bool
impl<const LEFT_SIZE: usize, const RIGHT_SIZE: usize> PartialOrd<WriteBuffer<RIGHT_SIZE>> for WriteBuffer<LEFT_SIZE>
fn partial_cmp(&self, other: &WriteBuffer<RIGHT_SIZE>) -> Option<Ordering>
impl<const SIZE: usize> AsRef<[u8]> for WriteBuffer<SIZE>
fn as_ref(&self) -> &[u8]
impl<const SIZE: usize> AsRef<str> for WriteBuffer<SIZE>
fn as_ref(&self) -> &str
impl<const SIZE: usize> Borrow<str> for WriteBuffer<SIZE>
fn borrow(&self) -> &str
impl<const SIZE: usize> Debug for WriteBuffer<SIZE>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<const SIZE: usize> Default for WriteBuffer<SIZE>
fn default() -> Self
impl<const SIZE: usize> Deref for WriteBuffer<SIZE>
type Target = str;fn deref(&self) -> &Self::Target
impl<const SIZE: usize> Display for WriteBuffer<SIZE>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<const SIZE: usize> Eq for WriteBuffer<SIZE>
impl<const SIZE: usize> Hash for WriteBuffer<SIZE>
fn hash<H: Hasher>(&self, state: &mut H)
impl<const SIZE: usize> Ord for WriteBuffer<SIZE>
fn cmp(&self, other: &Self) -> Ordering
impl<const SIZE: usize> SmartDisplay for WriteBuffer<SIZE>
type Metadata = ();fn metadata(&self, FormatterOptions) -> Metadata<'_, Self>fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<const SIZE: usize> Write for WriteBuffer<SIZE>
fn write_str(&mut self, s: &str) -> Result