Struct message_format::Context [] [src]

pub struct Context {
    pub language_tag: LanguageTag,
    pub placeholder_value: Option<i64>,
}

Contextual configuration data.

Fields

language_tag

The language being localized for.

placeholder_value

The value to use in a PlaceholderFormat.

Methods

impl Context

fn new(language: LanguageTag, placeholder_value: Option<i64>) -> Self

Create a new instance of Context.

fn format<'f>(&self, message: &Message, args: Option<&Args<'f>>) -> String

Format a message, returning a string.

fn write<'f>(&self, message: &Message, stream: &mut Write, args: Option<&Args<'f>>) -> Result

Write a message to a stream.

Trait Implementations

impl Default for Context

fn default() -> Self

Derived Implementations

impl Debug for Context

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Clone for Context

fn clone(&self) -> Context

1.0.0fn clone_from(&mut self, source: &Self)