Struct liquid::partials::LazyCompiler

source ·
pub struct LazyCompiler<S>
where S: PartialSource,
{ /* private fields */ }
Expand description

An lazily-caching compiler for PartialSource.

This would be useful in cases where:

  • Most partial-templates aren’t used
  • Of the used partial-templates, they are generally used many times.

Note: partial-compilation error reporting is deferred to render-time so content can still be generated even when the content is in an intermediate-state.

Implementations§

source§

impl<S> LazyCompiler<S>
where S: PartialSource,

source

pub fn new(source: S) -> LazyCompiler<S>

Create an on-demand compiler for PartialSource.

source§

impl<S> LazyCompiler<S>

source

pub fn empty() -> LazyCompiler<S>

Create an empty compiler for PartialSource.

Trait Implementations§

source§

impl<S> Debug for LazyCompiler<S>
where S: Debug + PartialSource,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<S> Default for LazyCompiler<S>

source§

fn default() -> LazyCompiler<S>

Returns the “default value” for a type. Read more
source§

impl<S> Deref for LazyCompiler<S>
where S: PartialSource,

§

type Target = S

The resulting type after dereferencing.
source§

fn deref(&self) -> &S

Dereferences the value.
source§

impl<S> DerefMut for LazyCompiler<S>
where S: PartialSource,

source§

fn deref_mut(&mut self) -> &mut S

Mutably dereferences the value.
source§

impl<S> PartialCompiler for LazyCompiler<S>
where S: PartialSource + Send + Sync + 'static,

source§

fn compile( self, language: Arc<Language> ) -> Result<Box<dyn PartialStore + Send + Sync>, Error>

Convert a PartialSource into a PartialStore.
source§

fn source(&self) -> &dyn PartialSource

Access underlying PartialSource

Auto Trait Implementations§

§

impl<S> Freeze for LazyCompiler<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for LazyCompiler<S>
where S: RefUnwindSafe,

§

impl<S> Send for LazyCompiler<S>
where S: Send,

§

impl<S> Sync for LazyCompiler<S>
where S: Sync,

§

impl<S> Unpin for LazyCompiler<S>
where S: Unpin,

§

impl<S> UnwindSafe for LazyCompiler<S>
where S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Any for T
where T: Any,

source§

impl<T> Formattable for T
where T: Deref, <T as Deref>::Target: Formattable,

source§

impl<T> Parsable for T
where T: Deref, <T as Deref>::Target: Parsable,