pub struct TextFunctionContext {
pub language: Option<UnicodeLanguageIdentifier>,
pub escape_function: EscapeFn,
pub safe_suffix: Option<String>,
}Expand description
Localization context
Fields§
§language: Option<UnicodeLanguageIdentifier>The default language to use.
If None the text() function will try to read the language from its context or expect it being passed explicitly using the lang parameter.
escape_function: EscapeFnThe escape function to use for unsafe inputs
safe_suffix: Option<String>The suffix for safe message ids and arguments
Implementations§
Source§impl TextFunctionContext
impl TextFunctionContext
Sourcepub fn matches_safe_suffix(&self, text: &str) -> bool
pub fn matches_safe_suffix(&self, text: &str) -> bool
Weather the given text matches the safe_suffix in this context.
Trait Implementations§
Source§impl Clone for TextFunctionContext
impl Clone for TextFunctionContext
Source§fn clone(&self) -> TextFunctionContext
fn clone(&self) -> TextFunctionContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TextFunctionContext
impl RefUnwindSafe for TextFunctionContext
impl Send for TextFunctionContext
impl Sync for TextFunctionContext
impl Unpin for TextFunctionContext
impl UnsafeUnpin for TextFunctionContext
impl UnwindSafe for TextFunctionContext
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