pub struct TemplateSetting {
pub language: Option<UnicodeLanguageIdentifier>,
pub format: HumusFormatIdentifier,
}Expand description
Language and format setting for the template
It is added as an extension to the request by the TemplateSettingsLayer.
When using axum you can retrieve it using:
ⓘ
async fn some_handler(
// … other arguments …,
Extension(settings): Extension<TemplateSetting>,
) -> Response {
// TODO
}Fields§
§language: Option<UnicodeLanguageIdentifier>The language to use for the template, None means that no preference could be extracted and that the backend should use the default languge.
format: HumusFormatIdentifierThe format identifier for giving to the templating engine.
Trait Implementations§
Source§impl Clone for TemplateSetting
impl Clone for TemplateSetting
Source§fn clone(&self) -> TemplateSetting
fn clone(&self) -> TemplateSetting
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 moreSource§impl Debug for TemplateSetting
impl Debug for TemplateSetting
Source§impl HumusQuerySettings for TemplateSetting
impl HumusQuerySettings for TemplateSetting
Source§fn get_format(&self) -> HumusFormatIdentifier
fn get_format(&self) -> HumusFormatIdentifier
Returns the requested output format.
Source§fn get_preferred_language(&self) -> Option<UnicodeLanguageIdentifier>
fn get_preferred_language(&self) -> Option<UnicodeLanguageIdentifier>
Returns the preferred language for the template
Auto Trait Implementations§
impl Freeze for TemplateSetting
impl RefUnwindSafe for TemplateSetting
impl Send for TemplateSetting
impl Sync for TemplateSetting
impl Unpin for TemplateSetting
impl UnsafeUnpin for TemplateSetting
impl UnwindSafe for TemplateSetting
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