pub struct Arguments<'a, F: AsRef<str>, T: Display + ?Sized + 'a, I: IntoIterator<Item = &'a T> + Clone> { /* private fields */ }
Expand description
This structure represents a format string combined with its arguments.
In contrast with fmt::Arguments
this structure can be easily and safely created at runtime.
Implementations§
Source§impl<'a, F: AsRef<str>, T: Display + ?Sized + 'a, I: IntoIterator<Item = &'a T> + Clone> Arguments<'a, F, T, I>
impl<'a, F: AsRef<str>, T: Display + ?Sized + 'a, I: IntoIterator<Item = &'a T> + Clone> Arguments<'a, F, T, I>
Sourcepub fn new(fmt: F, args: I) -> Self
pub fn new(fmt: F, args: I) -> Self
Creates a new instance of a Display
able structure, representing formatted arguments.
A runtime analog of format_args!
macro.
Extra arguments are ignored, missing arguments are replaced by empty string.
§Examples:
dyn_fmt::Arguments::new("{}a{}b{}c", &[1, 2, 3]); // "1a2b3c"
dyn_fmt::Arguments::new("{}a{}b{}c", &[1, 2, 3, 4]); // "1a2b3c"
dyn_fmt::Arguments::new("{}a{}b{}c", &[1, 2]); // "1a2bc"
dyn_fmt::Arguments::new("{{}}{}", &[1, 2]); // "{}1"
Trait Implementations§
Source§impl<'a, F: Clone + AsRef<str>, T: Clone + Display + ?Sized + 'a, I: Clone + IntoIterator<Item = &'a T> + Clone> Clone for Arguments<'a, F, T, I>
impl<'a, F: Clone + AsRef<str>, T: Clone + Display + ?Sized + 'a, I: Clone + IntoIterator<Item = &'a T> + Clone> Clone for Arguments<'a, F, T, I>
Auto Trait Implementations§
impl<'a, F, T, I> Freeze for Arguments<'a, F, T, I>
impl<'a, F, T, I> RefUnwindSafe for Arguments<'a, F, T, I>
impl<'a, F, T, I> Send for Arguments<'a, F, T, I>
impl<'a, F, T, I> Sync for Arguments<'a, F, T, I>
impl<'a, F, T, I> Unpin for Arguments<'a, F, T, I>
impl<'a, F, T, I> UnwindSafe for Arguments<'a, F, T, I>
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