pub struct FileSystemLoader { /* private fields */ }Expand description
Loads template files from a directory. Names are relative paths under root (POSIX-style
separators work on all platforms). .., absolute paths, and Windows path prefixes in name are
rejected. Resolved paths are canonicalized so symbolic links cannot escape root.
Implementations§
Trait Implementations§
Source§impl Debug for FileSystemLoader
impl Debug for FileSystemLoader
Source§impl TemplateLoader for FileSystemLoader
impl TemplateLoader for FileSystemLoader
fn load(&self, name: &str) -> Result<String>
Source§fn cache_key(&self, name: &str) -> Option<String>
fn cache_key(&self, name: &str) -> Option<String>
When
Some, parsed templates for this name may be cached in crate::Environment.
Return None for loaders whose sources are not stable by name (e.g. dynamic closures).Source§fn cache_key_cow<'a>(&self, name: &'a str) -> Option<Cow<'a, str>>
fn cache_key_cow<'a>(&self, name: &'a str) -> Option<Cow<'a, str>>
Borrow-friendly variant of
Self::cache_key. Read moreSource§fn cache_keys_are_stable(&self) -> bool
fn cache_keys_are_stable(&self) -> bool
Whether sources are immutable for keys returned by
Self::cache_key while this loader
instance is alive. When true, crate::Environment may reuse parsed ASTs for named
templates without reloading source on every render.Auto Trait Implementations§
impl Freeze for FileSystemLoader
impl RefUnwindSafe for FileSystemLoader
impl Send for FileSystemLoader
impl Sync for FileSystemLoader
impl Unpin for FileSystemLoader
impl UnsafeUnpin for FileSystemLoader
impl UnwindSafe for FileSystemLoader
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