pub struct Formatter<'c> { /* private fields */ }Expand description
Formats messages of one catalog.
Implementations§
Source§impl<'c> Formatter<'c>
impl<'c> Formatter<'c>
Sourcepub const fn new(
catalog: &'c Catalog,
registry: &'c Registry,
cx: &'c FormatContext,
) -> Self
pub const fn new( catalog: &'c Catalog, registry: &'c Registry, cx: &'c FormatContext, ) -> Self
A formatter over catalog, with the handlers of registry.
Sourcepub fn simple(&self, id: MsgId) -> Option<&'c str>
pub fn simple(&self, id: MsgId) -> Option<&'c str>
The text of a simple message whose text is valid: no evaluator, no
allocation. None for any other message (use Formatter::write).
Sourcepub fn write(
&self,
id: MsgId,
args: &[Arg<'_>],
out: &mut dyn Sink,
errs: &mut dyn ErrorSink,
)
pub fn write( &self, id: MsgId, args: &[Arg<'_>], out: &mut dyn Sink, errs: &mut dyn ErrorSink, )
Formats message id with positional args into out.
Sourcepub fn parts(
&self,
id: MsgId,
args: &[Arg<'_>],
out: &mut dyn PartSink,
errs: &mut dyn ErrorSink,
)
pub fn parts( &self, id: MsgId, args: &[Arg<'_>], out: &mut dyn PartSink, errs: &mut dyn ErrorSink, )
Formats message id with positional args to parts.
Trait Implementations§
Auto Trait Implementations§
impl<'c> !RefUnwindSafe for Formatter<'c>
impl<'c> !UnwindSafe for Formatter<'c>
impl<'c> Freeze for Formatter<'c>
impl<'c> Send for Formatter<'c>
impl<'c> Sync for Formatter<'c>
impl<'c> Unpin for Formatter<'c>
impl<'c> UnsafeUnpin for Formatter<'c>
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