pub struct NumBuffer<T: NumBufferTrait> { /* private fields */ }🔬This is a nightly-only experimental API. (
int_format_into #138215)Expand description
A buffer wrapper of which the internal size is based on the maximum number of digits the associated integer can have.
§Examples
#![feature(int_format_into)]
use core::fmt::NumBuffer;
let mut buf = NumBuffer::new();
let n1 = 1972u32;
assert_eq!(n1.format_into(&mut buf), "1972");
// Formatting a negative integer includes the sign.
let mut buf = NumBuffer::new();
let n2 = -1972i32;
assert_eq!(n2.format_into(&mut buf), "-1972");Implementations§
Source§impl<T: NumBufferTrait> NumBuffer<T>
impl<T: NumBufferTrait> NumBuffer<T>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for NumBuffer<T>
impl<T> RefUnwindSafe for NumBuffer<T>where
T: RefUnwindSafe,
impl<T> Send for NumBuffer<T>where
T: Send,
impl<T> Sync for NumBuffer<T>where
T: Sync,
impl<T> Unpin for NumBuffer<T>where
T: Unpin,
impl<T> UnsafeUnpin for NumBuffer<T>
impl<T> UnwindSafe for NumBuffer<T>where
T: UnwindSafe,
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