pub struct FixedBufStr<const N: usize> { /* private fields */ }Available on crate feature
format only.Expand description
Fixed length string buffer.
Implementations§
Source§impl<const N: usize> FixedBufStr<N>
impl<const N: usize> FixedBufStr<N>
Sourcepub fn new() -> FixedBufStr<N>
pub fn new() -> FixedBufStr<N>
Creates a new fixed length string buffer.
Sourcepub unsafe fn write(&mut self, buf: &[u8]) -> usize
pub unsafe fn write(&mut self, buf: &[u8]) -> usize
Appends a raw byte buffer at the end of this string buffer.
Returns the number of bytes written.
§Arguments
buf: the raw byte buffer to append.
returns: usize
§Safety
- FixedBufStr contains only valid UTF-8 strings so buf must contain only valid UTF-8 bytes.
- If buf contains invalid UTF-8 bytes, further operations on the log message buffer may result in UB.
Trait Implementations§
Source§impl<const N: usize> Clone for FixedBufStr<N>
impl<const N: usize> Clone for FixedBufStr<N>
Source§fn clone(&self) -> FixedBufStr<N>
fn clone(&self) -> FixedBufStr<N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const N: usize> Debug for FixedBufStr<N>
impl<const N: usize> Debug for FixedBufStr<N>
Source§impl<const N: usize> Default for FixedBufStr<N>
impl<const N: usize> Default for FixedBufStr<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for FixedBufStr<N>
impl<const N: usize> RefUnwindSafe for FixedBufStr<N>
impl<const N: usize> Send for FixedBufStr<N>
impl<const N: usize> Sync for FixedBufStr<N>
impl<const N: usize> Unpin for FixedBufStr<N>
impl<const N: usize> UnwindSafe for FixedBufStr<N>
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