Ignore

Struct Ignore 

Source
pub struct Ignore<A, E> { /* private fields */ }
Expand description

A simple non-diagnostical capturing context which ignores the error and loses all information about it (except that it happened).

Implementations§

Source§

impl<A, E> Ignore<A, E>
where A: Allocator,

Source

pub fn new(alloc: A) -> Ignore<A, E>

Construct a new ignoring context.

Source§

impl<A, E> Ignore<A, E>
where A: Allocator, E: Error,

Source

pub fn unwrap(self) -> E

Construct an error or panic.

Trait Implementations§

Source§

impl<A, E> Context for Ignore<A, E>
where A: Allocator,

Source§

type Input = E

The error type which is collected by the context.
Source§

type Error = Error

Error produced by context.
Source§

type Mark = ()

A mark during processing.
Source§

type Buf = <A as Allocator>::Buf

A growable buffer.
Source§

fn alloc(&mut self) -> <Ignore<A, E> as Context>::Buf

Allocate a buffer.
Source§

fn report<T>(&mut self, _: T) -> Error
where E: From<T>,

Report the given context error.
Source§

fn custom<T>(&mut self, _: T) -> Error
where T: 'static + Send + Sync + Display + Debug,

Report a custom error, which is not encapsulated by the error type expected by the context. This is essentially a type-erased way of reporting error-like things out from the context.
Source§

fn message<T>(&mut self, _: T) -> Error
where T: Display,

Report a message as an error. Read more
Source§

fn adapt<E>(&mut self) -> &mut Adapt<Self, E>
where Self::Input: From<E>,

Adapt the current context so that it can convert an error from a different type convertible to the current input Read more
Source§

fn marked_report<T>(&mut self, mark: Self::Mark, error: T) -> Self::Error
where Self::Input: From<T>,

Report the given encoding error from the given mark.
Source§

fn marked_message<T>(&mut self, mark: Self::Mark, message: T) -> Self::Error
where T: Display,

Report an error based on a mark. Read more
Source§

fn advance(&mut self, n: usize)

Advance the context by n bytes of input. Read more
Source§

fn mark(&mut self) -> Self::Mark

Return a mark which acts as a checkpoint at the current encoding state. Read more
Source§

fn invalid_variant_tag<T>(&mut self, _: &'static str, tag: T) -> Self::Error
where T: Debug,

Report that an invalid variant tag was encountered.
Source§

fn expected_tag<T>(&mut self, _: &'static str, tag: T) -> Self::Error
where T: Debug,

The value for the given tag could not be collected.
Source§

fn uninhabitable(&mut self, _: &'static str) -> Self::Error

Trying to decode an uninhabitable type.
Source§

fn invalid_field_tag<T>(&mut self, _: &'static str, tag: T) -> Self::Error
where T: Debug,

Encountered an unsupported field tag.
Source§

fn invalid_field_string_tag( &mut self, _: &'static str, field: Self::Buf, ) -> Self::Error

Encountered an unsupported field tag.
Source§

fn missing_variant_field<T>( &mut self, name: &'static str, tag: T, ) -> Self::Error
where T: Debug,

Missing variant field required to decode.
Source§

fn missing_variant_tag(&mut self, name: &'static str) -> Self::Error

Indicate that a variant tag could not be determined.
Source§

fn invalid_variant_field_tag<V, T>( &mut self, name: &'static str, variant: V, tag: T, ) -> Self::Error
where V: Debug, T: Debug,

Encountered an unsupported variant field.
Source§

fn enter_struct(&mut self, name: &'static str)

Indicate that we’ve entered a struct with the given name. Read more
Source§

fn leave_struct(&mut self)

Trace that we’ve left the last struct that was entered.
Source§

fn enter_enum(&mut self, name: &'static str)

Indicate that we’ve entered an enum with the given name. Read more
Source§

fn leave_enum(&mut self)

Trace that we’ve left the last enum that was entered.
Source§

fn enter_named_field<T>(&mut self, name: &'static str, tag: T)
where T: Display,

Trace that we’ve entered the given named field. Read more
Source§

fn enter_unnamed_field<T>(&mut self, index: u32, tag: T)
where T: Display,

Trace that we’ve entered the given unnamed field. Read more
Source§

fn leave_field(&mut self)

Trace that we’ve left the last field that was entered. Read more
Source§

fn enter_variant<T>(&mut self, name: &'static str, tag: T)
where T: Display,

Trace that we’ve entered the given variant in an enum. Read more
Source§

fn leave_variant(&mut self)

Trace that we’ve left the last variant that was entered. Read more
Source§

fn enter_map_key<T>(&mut self, field: T)
where T: Display,

Trace a that a map key has been entered.
Source§

fn leave_map_key(&mut self)

Trace that we’ve left the last map field that was entered. Read more
Source§

fn enter_sequence_index(&mut self, index: usize)

Trace a sequence field.
Source§

fn leave_sequence_index(&mut self)

Trace that we’ve left the last sequence index that was entered. Read more
Source§

impl<A, E> Default for Ignore<A, E>
where A: Default,

Source§

fn default() -> Ignore<A, E>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<A, E> Freeze for Ignore<A, E>
where A: Freeze,

§

impl<A, E> RefUnwindSafe for Ignore<A, E>

§

impl<A, E> Send for Ignore<A, E>
where A: Send, E: Send,

§

impl<A, E> Sync for Ignore<A, E>
where A: Sync, E: Sync,

§

impl<A, E> Unpin for Ignore<A, E>
where A: Unpin, E: Unpin,

§

impl<A, E> UnwindSafe for Ignore<A, E>
where A: UnwindSafe, E: 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V