pub struct Formatted<'a> {
pub sign: &'static str,
pub parts: &'a [Part<'a>],
}
🔬This is a nightly-only experimental API. (
numfmt
)Expand description
Formatted result containing one or more parts. This can be written to the byte buffer or converted to the allocated string.
Fields§
§sign: &'static str
🔬This is a nightly-only experimental API. (
numfmt
)A byte slice representing a sign, either ""
, "-"
or "+"
.
parts: &'a [Part<'a>]
🔬This is a nightly-only experimental API. (
numfmt
)Formatted parts to be rendered after a sign and optional zero padding.
Implementations§
source§impl<'a> Formatted<'a>
impl<'a> Formatted<'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 combined formatted result.
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 all formatted parts 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§
Auto Trait Implementations§
impl<'a> Freeze for Formatted<'a>
impl<'a> RefUnwindSafe for Formatted<'a>
impl<'a> Send for Formatted<'a>
impl<'a> Sync for Formatted<'a>
impl<'a> Unpin for Formatted<'a>
impl<'a> UnwindSafe for Formatted<'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