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: ?Sized, I> RefUnwindSafe for Arguments<'a, F, T, I>where F: RefUnwindSafe, I: RefUnwindSafe,
impl<'a, F, T: ?Sized, I> Send for Arguments<'a, F, T, I>where F: Send, I: Send,
impl<'a, F, T: ?Sized, I> Sync for Arguments<'a, F, T, I>where F: Sync, I: Sync,
impl<'a, F, T: ?Sized, I> Unpin for Arguments<'a, F, T, I>where F: Unpin, I: Unpin,
impl<'a, F, T: ?Sized, I> UnwindSafe for Arguments<'a, F, T, I>where F: UnwindSafe, I: UnwindSafe,
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