[−][src]Struct dangerous::Expected
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 theExpected
structure is136 bytes
large on 64 bit systems and successful parses may be hindered by the time to move theResult<T, Expected>
value. By boxing the internals ofExpected
the size becomes only8 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]
S: ContextStack,
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]
S: ContextStack,
fn input(&self) -> &'i Input
[src]
fn span(&self) -> &'i Input
[src]
fn expected(&self) -> Option<&Input>
[src]
fn description(&self, f: &mut Formatter<'_>) -> Result
[src]
fn context_stack(&self) -> &dyn ContextStack
[src]
impl<'i> Display for Expected<'i>
[src]
impl<'i> Error for Expected<'i>
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn description(&self) -> &str
1.0.0[src]
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl<'i, S> From<Expected<'i, S>> for Invalid where
S: ContextStack,
[src]
S: ContextStack,
impl<'i, S> From<ExpectedLength<'i>> for Expected<'i, S> where
S: ContextStackBuilder,
[src]
S: ContextStackBuilder,
fn from(err: ExpectedLength<'i>) -> Self
[src]
impl<'i, S> From<ExpectedValid<'i>> for Expected<'i, S> where
S: ContextStackBuilder,
[src]
S: ContextStackBuilder,
fn from(err: ExpectedValid<'i>) -> Self
[src]
impl<'i, S> From<ExpectedValue<'i>> for Expected<'i, S> where
S: ContextStackBuilder,
[src]
S: ContextStackBuilder,
fn from(err: ExpectedValue<'i>) -> Self
[src]
impl<'i, S> FromContext<'i> for Expected<'i, S> where
S: ContextStackBuilder,
[src]
S: ContextStackBuilder,
fn from_context<C>(self, input: &'i Input, context: C) -> Self where
C: Context,
[src]
C: Context,
impl<'i, S> IntoFatal for Expected<'i, S>
[src]
fn into_fatal(self) -> Self
[src]
impl<'i, S> ToRetryRequirement for Expected<'i, S>
[src]
fn to_retry_requirement(&self) -> Option<RetryRequirement>
[src]
fn is_fatal(&self) -> bool
[src]
Auto Trait Implementations
impl<'i, S> RefUnwindSafe for Expected<'i, S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<'i, S> Send for Expected<'i, S> where
S: Send,
S: Send,
impl<'i, S> Sync for Expected<'i, S> where
S: Sync,
S: Sync,
impl<'i, S> Unpin for Expected<'i, S>
impl<'i, S> UnwindSafe for Expected<'i, S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,