#[non_exhaustive]pub enum DecodeIncompleteAction<Value> {
Reject,
Skip,
Emit {
value: Value,
},
}Expand description
Action selected after end-of-input leaves a codec value incomplete.
The decode engine invokes this action only after the caller has established EOF. A non-rejecting action consumes every source unit still available from the current decode cursor.
§Type Parameters
Value: Decoded output value type.
§Examples
use qubit_codec::engine::DecodeIncompleteAction;
let action = DecodeIncompleteAction::<u8>::Emit { value: b'?' };
assert!(matches!(action, DecodeIncompleteAction::Emit { value: b'?' }));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Reject
Reject the incomplete source tail.
The decode engine reports the codec-domain error when available, or an
crate::TranscodeFailure::IncompleteInput framework error otherwise.
Skip
Consume the entire incomplete source tail without output.
Emit
Consume the entire incomplete source tail and emit one replacement.
Fields
§
value: ValueReplacement value to write to the output buffer.
Trait Implementations§
Source§impl<Value: Clone> Clone for DecodeIncompleteAction<Value>
impl<Value: Clone> Clone for DecodeIncompleteAction<Value>
Source§fn clone(&self) -> DecodeIncompleteAction<Value>
fn clone(&self) -> DecodeIncompleteAction<Value>
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<Value: Copy> Copy for DecodeIncompleteAction<Value>
Source§impl<Value: Debug> Debug for DecodeIncompleteAction<Value>
impl<Value: Debug> Debug for DecodeIncompleteAction<Value>
impl<Value: Eq> Eq for DecodeIncompleteAction<Value>
Source§impl<Value: Hash> Hash for DecodeIncompleteAction<Value>
impl<Value: Hash> Hash for DecodeIncompleteAction<Value>
Source§impl<Value: PartialEq> PartialEq for DecodeIncompleteAction<Value>
impl<Value: PartialEq> PartialEq for DecodeIncompleteAction<Value>
impl<Value: PartialEq> StructuralPartialEq for DecodeIncompleteAction<Value>
Auto Trait Implementations§
impl<Value> Freeze for DecodeIncompleteAction<Value>where
Value: Freeze,
impl<Value> RefUnwindSafe for DecodeIncompleteAction<Value>where
Value: RefUnwindSafe,
impl<Value> Send for DecodeIncompleteAction<Value>where
Value: Send,
impl<Value> Sync for DecodeIncompleteAction<Value>where
Value: Sync,
impl<Value> Unpin for DecodeIncompleteAction<Value>where
Value: Unpin,
impl<Value> UnsafeUnpin for DecodeIncompleteAction<Value>where
Value: UnsafeUnpin,
impl<Value> UnwindSafe for DecodeIncompleteAction<Value>where
Value: UnwindSafe,
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