pub enum Part<'a> {
Zero(usize),
Num(u16),
Copy(&'a [u8]),
}
🔬This is a nightly-only experimental API. (
numfmt
)Expand description
Formatted parts.
Variants§
Zero(usize)
🔬This is a nightly-only experimental API. (
numfmt
)Given number of zero digits.
Num(u16)
🔬This is a nightly-only experimental API. (
numfmt
)A literal number up to 5 digits.
Copy(&'a [u8])
🔬This is a nightly-only experimental API. (
numfmt
)A verbatim copy of given bytes.
Implementations§
source§impl<'a> Part<'a>
impl<'a> Part<'a>
sourcepub fn len(&self) -> usize
🔬This is a nightly-only experimental API. (numfmt
)
pub fn len(&self) -> usize
numfmt
)Returns the exact byte length of given part.
sourcepub fn write(&self, out: &mut [u8]) -> Option<usize>
🔬This is a nightly-only experimental API. (numfmt
)
pub fn write(&self, out: &mut [u8]) -> Option<usize>
numfmt
)Writes a part into the supplied buffer.
Returns the number of written bytes, or None
if the buffer is not enough.
(It may still leave partially written bytes in the buffer; do not rely on that.)
Trait Implementations§
source§impl<'a> PartialEq<Part<'a>> for Part<'a>
impl<'a> PartialEq<Part<'a>> for Part<'a>
impl<'a> Copy for Part<'a>
impl<'a> StructuralEq for Part<'a>
impl<'a> StructuralPartialEq for Part<'a>
Auto Trait Implementations§
impl<'a> Freeze for Part<'a>
impl<'a> RefUnwindSafe for Part<'a>
impl<'a> Send for Part<'a>
impl<'a> Sync for Part<'a>
impl<'a> Unpin for Part<'a>
impl<'a> UnwindSafe for Part<'a>
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