pub enum Arg<'a> {
Str(&'a str),
String(String),
UInt(u64),
SInt(i64, u8),
Float(f64),
USizeRef(&'a mut usize),
}
Expand description
Printf argument types.
Note no implementation of ToArg
constructs the owned variants (String and WString);
callers can do so explicitly.
Variants§
Implementations§
Source§impl<'a> Arg<'a>
impl<'a> Arg<'a>
pub fn set_count(&mut self, count: usize) -> Result<(), Error>
pub fn as_str<'s>(&'s self, storage: &'s mut String) -> Result<&'s str, Error>where
'a: 's,
pub fn as_uint(&self) -> Result<u64, Error>
pub fn as_sint(&self) -> Result<i64, Error>
pub fn as_wrapping_sint(&self) -> Result<(bool, u64), Error>
pub fn as_float(&self) -> Result<f64, Error>
pub fn as_char(&self) -> Result<char, Error>
Trait Implementations§
impl<'a> StructuralPartialEq for Arg<'a>
Auto Trait Implementations§
impl<'a> Freeze for Arg<'a>
impl<'a> RefUnwindSafe for Arg<'a>
impl<'a> Send for Arg<'a>
impl<'a> Sync for Arg<'a>
impl<'a> Unpin for Arg<'a>
impl<'a> !UnwindSafe for Arg<'a>
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