pub struct NumBuffer<T>where
T: NumBufferTrait,{
pub(crate) buf: <T as NumBufferTrait>::Buf,
phantom: PhantomData<T>,
}Expand description
A buffer wrapper of which the internal size is based on the maximum number of digits the associated integer can have.
§Examples
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");Fields§
§buf: <T as NumBufferTrait>::Buf§phantom: PhantomData<T>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for NumBuffer<T>
impl<T> RefUnwindSafe for NumBuffer<T>
impl<T> Send for NumBuffer<T>
impl<T> Sync for NumBuffer<T>
impl<T> Unpin for NumBuffer<T>
impl<T> UnsafeUnpin for NumBuffer<T>
impl<T> UnwindSafe for NumBuffer<T>
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