pub struct SimpleCurlyFormat;
Expand description
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§
Source§impl Debug for SimpleCurlyFormat
impl Debug for SimpleCurlyFormat
Auto Trait Implementations§
impl Freeze for SimpleCurlyFormat
impl RefUnwindSafe for SimpleCurlyFormat
impl Send for SimpleCurlyFormat
impl Sync for SimpleCurlyFormat
impl Unpin for SimpleCurlyFormat
impl UnwindSafe for SimpleCurlyFormat
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