Skip to main content

BindingError

Enum BindingError 

Source
#[non_exhaustive]
pub enum BindingError { Syntax { part: String, message: String, }, TemplateInOpaqueElement { part: String, element: String, offset: usize, }, TagSharesContainer { part: String, container: &'static str, span: Range<usize>, }, BodyCrossesContainer { part: String, open: Vec<usize>, close: Vec<usize>, }, LoopWrapsTable { part: String, span: Range<usize>, }, UnsupportedInlineLoop { part: String, path: Vec<usize>, }, MultipleTagsInBlock { part: String, path: Vec<usize>, first: Range<usize>, second: Range<usize>, }, UnclosedBlock { part: String, span: Range<usize>, }, UnexpectedTag { part: String, span: Range<usize>, }, MismatchedBlock { part: String, open: Range<usize>, close: Range<usize>, }, }
Expand description

An error raised while binding.

Every variant names the part and the block it came from, so a caller can match the cause without parsing the message.

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

Syntax

The template syntax could not be parsed.

Fields

§part: String

The part name.

§message: String

The parser message.

§

TemplateInOpaqueElement

A template delimiter was found inside an element the model does not type.

Fields

§part: String

The part name.

§element: String

The qualified element name.

§offset: usize

Offset of the delimiter within the opaque text.

§

TagSharesContainer

A structural tag shares its paragraph with other text.

Fields

§part: String

The part name.

§container: &'static str

The kind of container, such as paragraph.

§span: Range<usize>

The tag text range.

§

BodyCrossesContainer

A block opens in one container and closes in another.

Fields

§part: String

The part name.

§open: Vec<usize>

The opening container path.

§close: Vec<usize>

The closing container path.

§

LoopWrapsTable

A loop body wraps a whole table.

Fields

§part: String

The part name.

§span: Range<usize>

The opening tag range.

§

UnsupportedInlineLoop

An inline loop appears outside a table row.

Fields

§part: String

The part name.

§path: Vec<usize>

The paragraph path.

§

MultipleTagsInBlock

A paragraph holds two structural tags.

Fields

§part: String

The part name.

§path: Vec<usize>

The block path.

§first: Range<usize>

The first tag range.

§second: Range<usize>

The second tag range.

§

UnclosedBlock

A block was opened and never closed.

Fields

§part: String

The part name.

§span: Range<usize>

The opening tag range.

§

UnexpectedTag

A closing tag has no opening tag.

Fields

§part: String

The part name.

§span: Range<usize>

The tag range.

§

MismatchedBlock

A closing tag does not match the open block.

Fields

§part: String

The part name.

§open: Range<usize>

The opening tag range.

§close: Range<usize>

The closing tag range.

Trait Implementations§

Source§

impl Clone for BindingError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BindingError

Source§

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

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

impl Display for BindingError

Source§

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

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

impl Eq for BindingError

Source§

impl Error for BindingError

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<BindingError> for Error

Source§

fn from(source: BindingError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for BindingError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BindingError

Auto Trait Implementations§

§

impl Forget for BindingError

§

impl Freeze for BindingError

§

impl Move for BindingError

§

impl RefUnwindSafe for BindingError

§

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

§

impl Sync for BindingError
where RawVecInner: Sync,

§

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

§

impl UnsafeUnpin for BindingError

§

impl UnwindSafe for BindingError
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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.