pub enum StructurePattern {
Ignore,
Literal(Value),
Bind(ArcStr),
Slice {
all: Option<ArcStr>,
binds: Arc<[StructurePattern]>,
},
SlicePrefix {
all: Option<ArcStr>,
prefix: Arc<[StructurePattern]>,
tail: Option<ArcStr>,
},
SliceSuffix {
all: Option<ArcStr>,
head: Option<ArcStr>,
suffix: Arc<[StructurePattern]>,
},
Tuple {
all: Option<ArcStr>,
binds: Arc<[StructurePattern]>,
},
Variant {
all: Option<ArcStr>,
tag: ArcStr,
binds: Arc<[StructurePattern]>,
},
Struct {
exhaustive: bool,
all: Option<ArcStr>,
binds: Arc<[(ArcStr, StructurePattern)]>,
},
}
Variants§
Implementations§
Source§impl StructurePattern
impl StructurePattern
pub fn single_bind(&self) -> Option<&ArcStr>
pub fn with_names<'a>(&'a self, f: &mut impl FnMut(&'a ArcStr))
pub fn binds_uniq(&self) -> bool
pub fn infer_type_predicate(&self) -> Type
Trait Implementations§
Source§impl Clone for StructurePattern
impl Clone for StructurePattern
Source§fn clone(&self) -> StructurePattern
fn clone(&self) -> StructurePattern
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StructurePattern
impl Debug for StructurePattern
Source§impl Display for StructurePattern
impl Display for StructurePattern
Source§impl Ord for StructurePattern
impl Ord for StructurePattern
Source§fn cmp(&self, other: &StructurePattern) -> Ordering
fn cmp(&self, other: &StructurePattern) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for StructurePattern
impl PartialEq for StructurePattern
Source§impl PartialOrd for StructurePattern
impl PartialOrd for StructurePattern
impl Eq for StructurePattern
impl StructuralPartialEq for StructurePattern
Auto Trait Implementations§
impl Freeze for StructurePattern
impl RefUnwindSafe for StructurePattern
impl Send for StructurePattern
impl Sync for StructurePattern
impl Unpin for StructurePattern
impl UnwindSafe for StructurePattern
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string()
Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString
. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string()
Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString
. Read more