Skip to main content

RenderError

Enum RenderError 

Source
#[non_exhaustive]
pub enum RenderError {
Show 18 variants MissingValue { path: String, part: Option<String>, }, ExpectedIterable { path: String, actual: String, part: Option<String>, }, TypeMismatch { path: String, expected: &'static str, actual: &'static str, part: Option<String>, }, CurrentItemOutsideLoop, MetaOutsideLoop { name: String, }, CannotConvertToText { value_type: String, }, UnknownFilter { name: String, part: Option<String>, }, FilterFailed { name: String, message: String, part: Option<String>, }, InvalidComparison { operator: String, left: String, right: String, part: Option<String>, }, ArithmeticType { operator: String, actual: String, part: Option<String>, }, DivisionByZero { operator: String, part: Option<String>, }, ArithmeticOverflow { operator: String, part: Option<String>, }, InvalidLiteral { literal: String, part: Option<String>, }, ExpressionNotSupported { message: String, part: Option<String>, }, UnsupportedBlockPlacement { message: String, part: Option<String>, }, TextSpansContainers { part: String, paragraph: Vec<usize>, containers: Vec<Option<usize>>, }, InvalidPlanTarget { path: Vec<usize>, }, InvalidPlan { message: String, },
}
Expand description

Render error type.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

MissingValue

Value is missing for a placeholder.

Fields

§path: String

Path that could not be resolved.

§part: Option<String>

DOCX part where the error occurred, if known.

§

ExpectedIterable

Expected an iterable value but found something else.

Fields

§path: String

Path to the value.

§actual: String

Actual value kind found.

§part: Option<String>

DOCX part where the error occurred, if known.

§

TypeMismatch

Type mismatch during path resolution.

Fields

§path: String

Path being resolved.

§expected: &'static str

Expected type.

§actual: &'static str

Actual type found.

§part: Option<String>

DOCX part where the error occurred, if known.

§

CurrentItemOutsideLoop

Current item (.) used outside loop context.

§

MetaOutsideLoop

Loop metadata used outside loop context.

Fields

§name: String

The metadata name, for example @index.

§

CannotConvertToText

Cannot convert value to text for insertion.

Fields

§value_type: String

Type of value that cannot be converted.

§

UnknownFilter

A filter named in the template is not registered.

Fields

§name: String

The filter name as written in the template.

§part: Option<String>

DOCX part where the error occurred, if known.

§

FilterFailed

A filter rejected the value it received.

Fields

§name: String

The filter name as written in the template.

§message: String

The reason reported by the filter.

§part: Option<String>

DOCX part where the error occurred, if known.

§

InvalidComparison

Two values cannot be ordered with the requested operator.

Fields

§operator: String

The operator as written in the template.

§left: String

Type of the left value.

§right: String

Type of the right value.

§part: Option<String>

DOCX part where the error occurred, if known.

§

ArithmeticType

An arithmetic operator received a value that is not a number.

Fields

§operator: String

The operator as written in the template.

§actual: String

The type that is not a number.

§part: Option<String>

DOCX part where the error occurred, if known.

§

DivisionByZero

Division or remainder by zero.

Fields

§operator: String

The operator as written in the template.

§part: Option<String>

DOCX part where the error occurred, if known.

§

ArithmeticOverflow

Arithmetic produced a value outside the supported number range.

Fields

§operator: String

The operator as written in the template.

§part: Option<String>

DOCX part where the error occurred, if known.

§

InvalidLiteral

A number literal in the template is not a valid number.

Fields

§literal: String

The literal as written in the template.

§part: Option<String>

DOCX part where the error occurred, if known.

§

ExpressionNotSupported

An expression cannot be used in this position.

Fields

§message: String

Explanation of the unsupported use.

§part: Option<String>

DOCX part where the error occurred, if known.

§

UnsupportedBlockPlacement

Block placement is not supported in DOCX structure.

Fields

§message: String

Description of why placement is unsupported.

§part: Option<String>

DOCX part where the error occurred, if known.

§

TextSpansContainers

A placeholder spans two inline containers.

Fields

§part: String

The part name.

§paragraph: Vec<usize>

The paragraph path.

§containers: Vec<Option<usize>>

The container identities the span touched.

§

InvalidPlanTarget

A resolved edit points outside the region it belongs to.

Fields

§path: Vec<usize>

The path that could not be mapped.

§

InvalidPlan

The evaluator produced edits that overlap.

Fields

§message: String

The plan validation message.

Trait Implementations§

Source§

impl Debug for RenderError

Source§

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

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

impl Display for RenderError

Source§

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

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

impl Error for RenderError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Replaced by Error::source.
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<RenderError> for Error

Source§

fn from(source: RenderError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Forget for RenderError

§

impl Freeze for RenderError

§

impl Move for RenderError

§

impl RefUnwindSafe for RenderError

§

impl Send for RenderError
where RawVecInner: Send, &'static str: Send,

§

impl Sync for RenderError
where RawVecInner: Sync,

§

impl Unpin for RenderError
where *const u8 is !null: Unpin, &'static str: Unpin,

§

impl UnsafeUnpin for RenderError

§

impl UnwindSafe for RenderError
where RawVecInner: UnwindSafe, &'static str: 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.