Format

Struct Format 

Source
pub struct Format<'a, B, T>(pub &'a mut B, pub T);
Expand description

Const version of Buffer::format().

let mut buffer = const_itoa::Buffer::new();
let printed = buffer.format(1234i16);
assert_eq!(printed, "1234");

let mut buffer = const_itoa::Buffer::new();
let printed = const_itoa::Format(&mut buffer, 1234u16).call_once();
assert_eq!(printed, "1234");

let mut buffer = [std::mem::MaybeUninit::<u8>::uninit(); <i128 as const_itoa::Integer>::MAX_STR_LEN];
let printed = const_itoa::Format(&mut buffer, -1234i128).call_once();
assert_eq!(printed, "-1234");

Tuple Fields§

§0: &'a mut B§1: T

Implementations§

Source§

impl<'a> Format<'a, [MaybeUninit<u8>; 4], i8>

Source

pub const fn call_once(self) -> &'a str

Source§

impl<'a> Format<'a, Buffer, i8>

Source

pub const fn call_once(self) -> &'a str

Const version of Buffer::format().

Source§

impl<'a> Format<'a, [MaybeUninit<u8>; 3], u8>

Source

pub const fn call_once(self) -> &'a str

Source§

impl<'a> Format<'a, Buffer, u8>

Source

pub const fn call_once(self) -> &'a str

Const version of Buffer::format().

Source§

impl<'a> Format<'a, [MaybeUninit<u8>; 6], i16>

Source

pub const fn call_once(self) -> &'a str

Source§

impl<'a> Format<'a, Buffer, i16>

Source

pub const fn call_once(self) -> &'a str

Const version of Buffer::format().

Source§

impl<'a> Format<'a, [MaybeUninit<u8>; 5], u16>

Source

pub const fn call_once(self) -> &'a str

Source§

impl<'a> Format<'a, Buffer, u16>

Source

pub const fn call_once(self) -> &'a str

Const version of Buffer::format().

Source§

impl<'a> Format<'a, [MaybeUninit<u8>; 11], i32>

Source

pub const fn call_once(self) -> &'a str

Source§

impl<'a> Format<'a, Buffer, i32>

Source

pub const fn call_once(self) -> &'a str

Const version of Buffer::format().

Source§

impl<'a> Format<'a, [MaybeUninit<u8>; 10], u32>

Source

pub const fn call_once(self) -> &'a str

Source§

impl<'a> Format<'a, Buffer, u32>

Source

pub const fn call_once(self) -> &'a str

Const version of Buffer::format().

Source§

impl<'a> Format<'a, [MaybeUninit<u8>; 20], i64>

Source

pub const fn call_once(self) -> &'a str

Source§

impl<'a> Format<'a, Buffer, i64>

Source

pub const fn call_once(self) -> &'a str

Const version of Buffer::format().

Source§

impl<'a> Format<'a, [MaybeUninit<u8>; 20], u64>

Source

pub const fn call_once(self) -> &'a str

Source§

impl<'a> Format<'a, Buffer, u64>

Source

pub const fn call_once(self) -> &'a str

Const version of Buffer::format().

Source§

impl<'a> Format<'a, [MaybeUninit<u8>; 20], isize>

Source

pub const fn call_once(self) -> &'a str

Source§

impl<'a> Format<'a, Buffer, isize>

Source

pub const fn call_once(self) -> &'a str

Const version of Buffer::format().

Source§

impl<'a> Format<'a, [MaybeUninit<u8>; 20], usize>

Source

pub const fn call_once(self) -> &'a str

Source§

impl<'a> Format<'a, Buffer, usize>

Source

pub const fn call_once(self) -> &'a str

Const version of Buffer::format().

Source§

impl<'a> Format<'a, [MaybeUninit<u8>; 40], i128>

Source

pub const fn call_once(self) -> &'a str

Source§

impl<'a> Format<'a, Buffer, i128>

Source

pub const fn call_once(self) -> &'a str

Const version of Buffer::format().

Source§

impl<'a> Format<'a, [MaybeUninit<u8>; 39], u128>

Source

pub const fn call_once(self) -> &'a str

Source§

impl<'a> Format<'a, Buffer, u128>

Source

pub const fn call_once(self) -> &'a str

Const version of Buffer::format().

Auto Trait Implementations§

§

impl<'a, B, T> Freeze for Format<'a, B, T>
where T: Freeze,

§

impl<'a, B, T> RefUnwindSafe for Format<'a, B, T>

§

impl<'a, B, T> Send for Format<'a, B, T>
where T: Send, B: Send,

§

impl<'a, B, T> Sync for Format<'a, B, T>
where T: Sync, B: Sync,

§

impl<'a, B, T> Unpin for Format<'a, B, T>
where T: Unpin,

§

impl<'a, B, T> !UnwindSafe for Format<'a, B, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.