Struct Argument

#[repr(align(2))]
pub struct Argument<'a> { pub(in ::fmt::rt) ty: ArgumentType<'a> }

This struct represents a generic "argument" which is taken by format_args!().

This can be either a placeholder argument or a count argument.

Fields

ty: ArgumentType<'a>

Implementations

impl Argument<'_>

const fn new_display<T: Display>(x: &T) -> Argument<'_>
const fn new_debug<T: Debug>(x: &T) -> Argument<'_>
const fn new_debug_noop<T: Debug>(x: &T) -> Argument<'_>
const fn new_octal<T: Octal>(x: &T) -> Argument<'_>
const fn new_lower_hex<T: LowerHex>(x: &T) -> Argument<'_>
const fn new_upper_hex<T: UpperHex>(x: &T) -> Argument<'_>
const fn new_pointer<T: Pointer>(x: &T) -> Argument<'_>
const fn new_binary<T: Binary>(x: &T) -> Argument<'_>
const fn new_lower_exp<T: LowerExp>(x: &T) -> Argument<'_>
const fn new_upper_exp<T: UpperExp>(x: &T) -> Argument<'_>
const fn from_usize(x: &usize) -> Argument<'_>
unsafe fn fmt(&self, f: &mut Formatter<'_>) -> Result

Format this placeholder argument.

Safety

This argument must actually be a placeholder argument.

const fn as_u16(&self) -> Option<u16>

Trait Implementations

impl<'a> Clone for Argument<'a>

fn clone(&self) -> Argument<'a>

impl<'a> Copy for Argument<'a>

impl<'a> TrivialClone for Argument<'a>

Auto Trait Implementations

impl<'a> !Send for Argument<'a>

impl<'a> !Sync for Argument<'a>

impl<'a> Freeze for Argument<'a>

impl<'a> RefUnwindSafe for Argument<'a>

impl<'a> Unpin for Argument<'a>

impl<'a> UnsafeUnpin for Argument<'a>

impl<'a> UnwindSafe for Argument<'a>

Blanket Implementations

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

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Argument<'a> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Argument<'a> where T: ?Sized,

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

impl<T> CloneToUninit for Argument<'a> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Argument<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for Argument<'a> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for Argument<'a>

impl<T, U> Into<U> for Argument<'a> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom<U> for Argument<'a> 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 Argument<'a> where U: TryFrom<T>,

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