#[repr(isize)]pub enum DecodingFailurePolicy {
RaiseException = 0,
SetErrorAndReturn = 1,
}Expand description
Describes the action an ns::Coder should take when it encounters decode failures (e.g. corrupt data) for non-TopLevel decodes.
Variants§
RaiseException = 0
On decode failure, the ns::Coder will raise an exception internally
to propagate failure messages (and unwind the stack). This exception can be transformed
into an ns::Error via any of the TopLevel decode APIs.
SetErrorAndReturn = 1
On decode failure, the ns::Coder will capture the failure as an ns::Error,
and prevent further decodes (by returning 0 / None equivalent as appropriate).
Clients should consider using this policy if they know that all encoded objects behave correctly
in the presence of decode failures (e.g. they use fail_with_error to communicate decode failures
and don’t raise exceptions for error propagation)
Trait Implementations§
Source§impl Clone for DecodingFailurePolicy
impl Clone for DecodingFailurePolicy
Source§fn clone(&self) -> DecodingFailurePolicy
fn clone(&self) -> DecodingFailurePolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DecodingFailurePolicy
Source§impl Debug for DecodingFailurePolicy
impl Debug for DecodingFailurePolicy
impl Eq for DecodingFailurePolicy
Source§impl PartialEq for DecodingFailurePolicy
impl PartialEq for DecodingFailurePolicy
Source§fn eq(&self, other: &DecodingFailurePolicy) -> bool
fn eq(&self, other: &DecodingFailurePolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DecodingFailurePolicy
Auto Trait Implementations§
impl Freeze for DecodingFailurePolicy
impl RefUnwindSafe for DecodingFailurePolicy
impl Send for DecodingFailurePolicy
impl Sync for DecodingFailurePolicy
impl Unpin for DecodingFailurePolicy
impl UnsafeUnpin for DecodingFailurePolicy
impl UnwindSafe for DecodingFailurePolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more