pub struct 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 index 0
.
{name}
: Refers to the named argument with key "name"
.
use dynfmt::{Format, SimpleCurlyFormat};
let formatted = SimpleCurlyFormat.format("hello, {}", &["world"]);
assert_eq!("hello, world", formatted.expect("formatting failed"));
The iterator returned by [iter_args
]. Read more
Returns an iterator over format arguments in the format string. Read more
Formats the given string with the specified arguments. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)