pub enum DecodePosition {
Eval,
Quote,
Data,
Pattern,
}Expand description
The syntactic position a decode is targeting, mirroring the kernel’s
EncodePosition.
Position is the core idea of the codec contract: a decoder reads the same
text differently depending on where its result will land. A codec may, for
example, lower forms to calls in DecodePosition::Eval but keep them as
data everywhere else (see CodecDefaultDecode::target_for).
Variants§
Eval
Decoding into evaluable position: the result will be evaluated.
Quote
Decoding inside a quote: the result is literal structure, not evaluated.
Data
Decoding as plain data.
Pattern
Decoding into a pattern (match/binding) position.
Trait Implementations§
Source§impl Clone for DecodePosition
impl Clone for DecodePosition
Source§fn clone(&self) -> DecodePosition
fn clone(&self) -> DecodePosition
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 DecodePosition
Source§impl Debug for DecodePosition
impl Debug for DecodePosition
impl Eq for DecodePosition
Source§impl From<EncodePosition> for DecodePosition
impl From<EncodePosition> for DecodePosition
Source§fn from(position: EncodePosition) -> Self
fn from(position: EncodePosition) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DecodePosition
impl PartialEq for DecodePosition
Source§fn eq(&self, other: &DecodePosition) -> bool
fn eq(&self, other: &DecodePosition) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DecodePosition
Auto Trait Implementations§
impl Freeze for DecodePosition
impl RefUnwindSafe for DecodePosition
impl Send for DecodePosition
impl Sync for DecodePosition
impl Unpin for DecodePosition
impl UnsafeUnpin for DecodePosition
impl UnwindSafe for DecodePosition
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