[−][src]Struct dynfmt::curly::SimpleCurlyFormat
Format implementation for simple curly brace based format strings.
This syntax is a subset of what Python 3, Rust, .NET and many logging libraries use. Each argument is formated in display mode.
{}
: Refers to the next positional argument.{0}
: Refers to the argument at index0
.{name}
: Refers to the named argument with key"name"
.
Example
use dynfmt::{Format, SimpleCurlyFormat}; let formatted = SimpleCurlyFormat.format("hello, {}", &["world"]); assert_eq!("hello, world", formatted.expect("formatting failed"));
Trait Implementations
impl<'f> Format<'f> for SimpleCurlyFormat
[src]
type Iter = SimpleCurlyIter<'f>
The iterator returned by [iter_args
]. Read more
fn iter_args(&self, format: &'f str) -> Result<Self::Iter, Error<'f>>
[src]
fn format<A>(
&self,
format: &'f str,
arguments: A
) -> Result<Cow<'f, str>, Error<'f>> where
A: FormatArgs,
[src]
&self,
format: &'f str,
arguments: A
) -> Result<Cow<'f, str>, Error<'f>> where
A: FormatArgs,
Formats the given string with the specified arguments. Read more
Auto Trait Implementations
impl Send for SimpleCurlyFormat
impl Unpin for SimpleCurlyFormat
impl Sync for SimpleCurlyFormat
impl UnwindSafe for SimpleCurlyFormat
impl RefUnwindSafe for SimpleCurlyFormat
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,