pub struct FormatString {
pub fragments: Vec<FormatFragment>,
}Expand description
A parsed format string.
Fields§
§fragments: Vec<FormatFragment>The FormatFragments that comprise the FormatString.
Implementations§
Source§impl FormatString
impl FormatString
Sourcepub fn format(&self, args: &[Arg], style: FormatStyle) -> String
pub fn format(&self, args: &[Arg], style: FormatStyle) -> String
Formats a parsed format string with provided arguments.
Sourcepub fn format_with_errors<FE: FormatError>(
&self,
args: &[Result<Arg, FE::Error>],
style: FormatStyle,
error_formatter: &FE,
) -> String
pub fn format_with_errors<FE: FormatError>( &self, args: &[Result<Arg, FE::Error>], style: FormatStyle, error_formatter: &FE, ) -> String
Formats a parsed format string with the provided argument states (Result<Arg, FE::Error>),
delegating formatting of any failures, missing arguments, or type mismatches
to the provided FormatError implementation.
Sourcepub fn parse_printf(s: &str) -> Result<Self, String>
pub fn parse_printf(s: &str) -> Result<Self, String>
Parses a printf style format string.
Sourcepub fn parse_core_fmt(s: &str) -> Result<Self, String>
pub fn parse_core_fmt(s: &str) -> Result<Self, String>
Parses a core::fmt style format string.
Trait Implementations§
Source§impl Clone for FormatString
impl Clone for FormatString
Source§fn clone(&self) -> FormatString
fn clone(&self) -> FormatString
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FormatString
impl Debug for FormatString
Source§impl PartialEq for FormatString
impl PartialEq for FormatString
impl Eq for FormatString
impl StructuralPartialEq for FormatString
Auto Trait Implementations§
impl Freeze for FormatString
impl RefUnwindSafe for FormatString
impl Send for FormatString
impl Sync for FormatString
impl Unpin for FormatString
impl UnsafeUnpin for FormatString
impl UnwindSafe for FormatString
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