Struct liquid::ParserBuilder

source ·
pub struct ParserBuilder<P = EagerCompiler<InMemorySource>>where
    P: PartialCompiler,{ /* private fields */ }

Implementations§

source§

impl ParserBuilder<EagerCompiler<InMemorySource>>

source

pub fn new() -> Self

Create an empty Liquid parser

source

pub fn with_stdlib() -> Self

Available on crate feature stdlib only.
source§

impl<P> ParserBuilder<P>where P: PartialCompiler,

source

pub fn stdlib(self) -> Self

Available on crate feature stdlib only.

Create a Liquid parser with built-in Liquid features

source

pub fn block<B: Into<Box<dyn ParseBlock>>>(self, block: B) -> Self

Inserts a new custom block into the parser

source

pub fn tag<T: Into<Box<dyn ParseTag>>>(self, tag: T) -> Self

Inserts a new custom tag into the parser

source

pub fn filter<F: Into<Box<dyn ParseFilter>>>(self, filter: F) -> Self

Inserts a new custom filter into the parser

source

pub fn partials<N: PartialCompiler>(self, partials: N) -> ParserBuilder<N>

Set which partial-templates will be available.

source

pub fn build(self) -> Result<Parser>

Create a parser

Trait Implementations§

source§

impl<P> Default for ParserBuilder<P>where P: PartialCompiler,

source§

fn default() -> Self

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

impl<P> ParserReflection for ParserBuilder<P>where P: PartialCompiler,

source§

fn blocks<'r>(&'r self) -> Box<dyn Iterator<Item = &dyn BlockReflection> + 'r>

source§

fn tags<'r>(&'r self) -> Box<dyn Iterator<Item = &dyn TagReflection> + 'r>

source§

fn filters<'r>(&'r self) -> Box<dyn Iterator<Item = &dyn FilterReflection> + 'r>

source§

fn partials<'r>(&'r self) -> Box<dyn Iterator<Item = &str> + 'r>

Auto Trait Implementations§

§

impl<P = EagerCompiler<InMemorySource>> !RefUnwindSafe for ParserBuilder<P>

§

impl<P> Send for ParserBuilder<P>where P: Send,

§

impl<P> Sync for ParserBuilder<P>where P: Sync,

§

impl<P> Unpin for ParserBuilder<P>where P: Unpin,

§

impl<P = EagerCompiler<InMemorySource>> !UnwindSafe for ParserBuilder<P>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere 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 Twhere 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.
§

impl<T> Any for Twhere T: Any,