Struct chumsky::error::Located

source ·
pub struct Located<I, E> { /* private fields */ }
Expand description

An internal type used to facilitate error prioritisation. You shouldn’t need to interact with this type during normal use of the crate.

Implementations§

source§

impl<I, E: Error<I>> Located<I, E>

source

pub fn at(at: usize, error: E) -> Self

Create a new Located with the give input position and error.

source

pub fn max(self, other: impl Into<Option<Self>>) -> Self

Get the maximum of two located errors. If they hold the same position in the input, merge them.

source

pub fn map<U, F: FnOnce(E) -> U>(self, f: F) -> Located<I, U>

Map the error with the given function.

Auto Trait Implementations§

§

impl<I, E> RefUnwindSafe for Located<I, E>where E: RefUnwindSafe, I: RefUnwindSafe,

§

impl<I, E> Send for Located<I, E>where E: Send, I: Send,

§

impl<I, E> Sync for Located<I, E>where E: Sync, I: Sync,

§

impl<I, E> Unpin for Located<I, E>where E: Unpin, I: Unpin,

§

impl<I, E> UnwindSafe for Located<I, E>where E: UnwindSafe, I: UnwindSafe,

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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> Chain<T> for T

source§

fn len(&self) -> usize

The number of items that this chain link consists of.
source§

fn append_to(self, v: &mut Vec<T, Global>)

Append the elements in this link to the chain.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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.
const: unstable · 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.
const: unstable · source§

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

Performs the conversion.