Struct bp3d_util::format::FixedBufStr
source · 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 copy 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