[][src]Struct dangerous::Expected

pub struct Expected<'i, S = FullContextStack> { /* fields omitted */ }

A catch-all error for all expected errors supported in this crate.

  • Enable the full-context feature (enabled by default), for full-context stacks.
  • It is generally recommended for better performance to have the box-expected feature enabled (enabled by default) if the structures being returned from parsing are smaller than or equal to ~128 bytes. This is because the Expected structure is 136 bytes large on 64 bit systems and successful parses may be hindered by the time to move the Result<T, Expected> value. By boxing the internals of Expected the size becomes only 8 bytes. When in doubt, write a benchmark.

See crate::error for additional documentation around the error system.

Implementations

impl<'i, S> Expected<'i, S> where
    S: ContextStack
[src]

pub fn display(&self) -> ErrorDisplay<'_, Self>[src]

Returns an ErrorDisplay for formatting.

Trait Implementations

impl<'i> Debug for Expected<'i>[src]

impl<'i, S> Details<'i> for Expected<'i, S> where
    S: ContextStack
[src]

impl<'i> Display for Expected<'i>[src]

impl<'i> Error for Expected<'i>[src]

impl<'i, S> From<Expected<'i, S>> for Invalid where
    S: ContextStack
[src]

impl<'i, S> From<ExpectedLength<'i>> for Expected<'i, S> where
    S: ContextStackBuilder
[src]

impl<'i, S> From<ExpectedValid<'i>> for Expected<'i, S> where
    S: ContextStackBuilder
[src]

impl<'i, S> From<ExpectedValue<'i>> for Expected<'i, S> where
    S: ContextStackBuilder
[src]

impl<'i, S> FromContext<'i> for Expected<'i, S> where
    S: ContextStackBuilder
[src]

impl<'i, S> IntoFatal for Expected<'i, S>[src]

impl<'i, S> ToRetryRequirement for Expected<'i, S>[src]

Auto Trait Implementations

impl<'i, S> RefUnwindSafe for Expected<'i, S> where
    S: RefUnwindSafe

impl<'i, S> Send for Expected<'i, S> where
    S: Send

impl<'i, S> Sync for Expected<'i, S> where
    S: Sync

impl<'i, S> Unpin for Expected<'i, S>

impl<'i, S> UnwindSafe for Expected<'i, S> where
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.