Error

Enum Error 

Source
pub enum Error<E, R> {
    Syntax(SyntaxError<E>),
    Render(R),
    IO(Error),
    Fmt(Error),
}
Expand description

A general error type capturing any error which could occur while compiling or rendering a template string.

This error type is used by the Oneshot render methods, though it could also be useful for handling any error which might occur in this crate since it implements From<T> for the following types T:

Variants§

§

Syntax(SyntaxError<E>)

An error when compiling the template string.

§

Render(R)

A value in an expression could not be rendered.

§

IO(Error)

An error occured while writing to an io::Write.

§

Fmt(Error)

An error occured while writing to a fmt::Write.

Trait Implementations§

Source§

impl<E: Debug, R: Debug> Debug for Error<E, R>

Source§

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

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

impl<E, R> From<Error> for Error<E, R>

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl<E, R> From<Error> for Error<E, R>

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl<E, R> From<FmtRenderError<R>> for Error<E, R>

Source§

fn from(err: FmtRenderError<R>) -> Self

Converts to this type from the input type.
Source§

impl<E, R> From<IORenderError<R>> for Error<E, R>

Source§

fn from(err: IORenderError<R>) -> Self

Converts to this type from the input type.
Source§

impl<E, R> From<SyntaxError<E>> for Error<E, R>

Source§

fn from(err: SyntaxError<E>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<E, R> Freeze for Error<E, R>
where R: Freeze, E: Freeze,

§

impl<E, R> !RefUnwindSafe for Error<E, R>

§

impl<E, R> Send for Error<E, R>
where R: Send, E: Send,

§

impl<E, R> Sync for Error<E, R>
where R: Sync, E: Sync,

§

impl<E, R> Unpin for Error<E, R>
where R: Unpin, E: Unpin,

§

impl<E, R> !UnwindSafe for Error<E, R>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.