Struct NumBuffer
pub struct NumBuffer<T: NumBufferTrait> { pub(crate) buf: T::Buf, pub(in ::fmt::num_buffer) phantom: PhantomData<T> }
A buffer wrapper of which the internal size is based on the maximum number of digits the associated integer can have.
Examples
use NumBuffer;
let mut buf = new;
let n1 = 1972u32;
assert_eq!;
// Formatting a negative integer includes the sign.
let mut buf = new;
let n2 = -1972i32;
assert_eq!;
Fields
buf: T::Bufphantom: PhantomData<T>
Implementations
impl<T: NumBufferTrait> NumBuffer<T>
const fn new() -> SelfInitializes internal buffer.
Trait Implementations
impl<T: NumBufferTrait> Debug for NumBuffer<T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<T> Freeze for NumBuffer<T>
where
<T as NumBufferTrait>::Buf: Freeze,
PhantomData<T>: Freeze,
impl<T> RefUnwindSafe for NumBuffer<T>
where
<T as NumBufferTrait>::Buf: RefUnwindSafe,
PhantomData<T>: RefUnwindSafe,
impl<T> Send for NumBuffer<T>
where
<T as NumBufferTrait>::Buf: Send,
PhantomData<T>: Send,
impl<T> Sync for NumBuffer<T>
where
<T as NumBufferTrait>::Buf: Sync,
PhantomData<T>: Sync,
impl<T> Unpin for NumBuffer<T>
where
<T as NumBufferTrait>::Buf: Unpin,
PhantomData<T>: Unpin,
impl<T> UnsafeUnpin for NumBuffer<T>
where
<T as NumBufferTrait>::Buf: UnsafeUnpin,
PhantomData<T>: UnsafeUnpin,
impl<T> UnwindSafe for NumBuffer<T>
where
<T as NumBufferTrait>::Buf: UnwindSafe,
PhantomData<T>: UnwindSafe,
Blanket Implementations
impl<T> Any for NumBuffer<T>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for NumBuffer<T>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for NumBuffer<T>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for NumBuffer<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for NumBuffer<T>
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for NumBuffer<T>
impl<T, U> Into<U> for NumBuffer<T>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for NumBuffer<T>
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for NumBuffer<T>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>