pub struct TemplateRegistry { /* private fields */ }Implementations§
Source§impl TemplateRegistry
impl TemplateRegistry
pub fn new() -> TemplateRegistry
pub fn register_provider(&mut self, provider: Arc<dyn TemplateProvider>)
pub fn register_loader(&mut self, loader: Arc<dyn TemplateLoader>)
pub fn register_extender(&mut self, extender: Arc<dyn TemplateDataExtender>)
pub fn register_component(&mut self, component: Arc<dyn ComponentRenderer>)
pub fn register_page_provider(&mut self, provider: Arc<dyn PageDataProvider>)
pub fn register_page_prerenderer( &mut self, prerenderer: Arc<dyn PagePrerenderer>, )
pub async fn initialize(&mut self) -> Result<(), TemplateError>
pub fn render( &self, template_name: &str, data: &Value, ) -> Result<String, TemplateError>
pub fn render_partial( &self, partial_name: &str, data: &Value, ) -> Result<String, TemplateError>
pub fn has_partial(&self, partial_name: &str) -> bool
pub fn has_template(&self, name: &str) -> bool
pub fn find_template(&self, name: &str) -> Option<&TemplateDefinition>
pub fn find_template_for_content_type(&self, content_type: &str) -> Option<&str>
pub fn extenders_for( &self, content_type: &str, ) -> Vec<&Arc<dyn TemplateDataExtender>>
pub fn components_for( &self, content_type: &str, ) -> Vec<&Arc<dyn ComponentRenderer>>
pub fn page_providers_for( &self, page_type: &str, ) -> Vec<&Arc<dyn PageDataProvider>>
pub fn page_prerenderers(&self) -> &[Arc<dyn PagePrerenderer>]
pub fn find_template_provider(&self, name: &str) -> Option<&str>
pub fn template_names(&self) -> Vec<&str>
pub fn available_content_types(&self) -> Vec<String>
pub fn stats(&self) -> RegistryStats
Trait Implementations§
Source§impl Debug for TemplateRegistry
impl Debug for TemplateRegistry
Source§impl Default for TemplateRegistry
impl Default for TemplateRegistry
Source§fn default() -> TemplateRegistry
fn default() -> TemplateRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TemplateRegistry
impl !RefUnwindSafe for TemplateRegistry
impl Send for TemplateRegistry
impl Sync for TemplateRegistry
impl Unpin for TemplateRegistry
impl !UnwindSafe for TemplateRegistry
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more