pub struct TemplateConfig {
pub template_dir: PathBuf,
pub extension: String,
pub enable_cache: bool,
}Expand description
模板配置
Fields§
§template_dir: PathBuf模板根目录
extension: String模板文件扩展名
enable_cache: bool是否启用缓存(生产环境建议启用)
Implementations§
Source§impl TemplateConfig
impl TemplateConfig
Sourcepub fn with_template_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn with_template_dir(self, dir: impl Into<PathBuf>) -> Self
设置模板目录
Sourcepub fn with_extension(self, ext: impl Into<String>) -> Self
pub fn with_extension(self, ext: impl Into<String>) -> Self
设置模板扩展名
Sourcepub fn with_cache(self, enable: bool) -> Self
pub fn with_cache(self, enable: bool) -> Self
设置是否启用缓存
Trait Implementations§
Source§impl Clone for TemplateConfig
impl Clone for TemplateConfig
Source§fn clone(&self) -> TemplateConfig
fn clone(&self) -> TemplateConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 TemplateConfig
impl Debug for TemplateConfig
Auto Trait Implementations§
impl Freeze for TemplateConfig
impl RefUnwindSafe for TemplateConfig
impl Send for TemplateConfig
impl Sync for TemplateConfig
impl Unpin for TemplateConfig
impl UnsafeUnpin for TemplateConfig
impl UnwindSafe for TemplateConfig
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