pub struct DejaVuRenderer { /* private fields */ }Expand description
DejaVu 模板渲染器
Implementations§
Source§impl DejaVuRenderer
impl DejaVuRenderer
Sourcepub fn with_template_config(template_config: TemplateConfig) -> Self
pub fn with_template_config(template_config: TemplateConfig) -> Self
使用自定义模板配置创建 DejaVu 渲染器
Trait Implementations§
Source§impl Default for DejaVuRenderer
impl Default for DejaVuRenderer
Source§impl TemplateRenderer for DejaVuRenderer
impl TemplateRenderer for DejaVuRenderer
Source§fn register_template(&mut self, name: &str, content: &str) -> TemplateResult<()>
fn register_template(&mut self, name: &str, content: &str) -> TemplateResult<()>
注册模板
Source§fn register_template_file(
&mut self,
name: &str,
path: &Path,
) -> TemplateResult<()>
fn register_template_file( &mut self, name: &str, path: &Path, ) -> TemplateResult<()>
注册模板文件
Source§fn register_templates_from_dir(
&mut self,
dir: &Path,
extension: Option<&str>,
) -> TemplateResult<()>
fn register_templates_from_dir( &mut self, dir: &Path, extension: Option<&str>, ) -> TemplateResult<()>
从目录注册所有模板
Source§fn render_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
template_name: &'life1 str,
context: &'life2 Value,
) -> Pin<Box<dyn Future<Output = TemplateResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn render_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
template_name: &'life1 str,
context: &'life2 Value,
) -> Pin<Box<dyn Future<Output = TemplateResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
异步渲染单个模板
Auto Trait Implementations§
impl Freeze for DejaVuRenderer
impl RefUnwindSafe for DejaVuRenderer
impl Send for DejaVuRenderer
impl Sync for DejaVuRenderer
impl Unpin for DejaVuRenderer
impl UnsafeUnpin for DejaVuRenderer
impl UnwindSafe for DejaVuRenderer
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