pub struct Engine { /* private fields */ }Expand description
A theme’s templates, compiled and ready to render.
Implementations§
Source§impl Engine
impl Engine
Sourcepub async fn build(db: &Db, code: &str) -> Result<Engine, ThemeError>
pub async fn build(db: &Db, code: &str) -> Result<Engine, ThemeError>
Compiles the theme code with its ancestors.
Sourcepub async fn build_with(
db: &Db,
code: &str,
configure: impl FnOnce(&mut Environment<'static>),
) -> Result<Engine, ThemeError>
pub async fn build_with( db: &Db, code: &str, configure: impl FnOnce(&mut Environment<'static>), ) -> Result<Engine, ThemeError>
Like Engine::build, with a hook that adds the application’s own
functions, filters and globals to the environment before the templates
compile.
Sourcepub fn stamp(&self) -> &str
pub fn stamp(&self) -> &str
Changes when the theme or an ancestor does; EngineCache compares it.
Sourcepub fn env(&self) -> &Environment<'static>
pub fn env(&self) -> &Environment<'static>
The environment, for a render path that needs more than Engine::render.
Auto Trait Implementations§
impl !Freeze for Engine
impl !RefUnwindSafe for Engine
impl !UnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnsafeUnpin for Engine
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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