pub enum ShapeNormalKind {
Any,
Atom(Symbol),
And(Vec<ShapeNormalForm>),
Or(Vec<ShapeNormalForm>),
Not(Box<ShapeNormalForm>),
List {
items: Vec<ShapeNormalForm>,
rest: Option<Box<ShapeNormalForm>>,
},
Table {
fields: Vec<(Symbol, ShapeNormalForm)>,
closed: bool,
},
Repeat {
body: Box<ShapeNormalForm>,
min: usize,
max: Option<usize>,
},
Opaque,
}Expand description
Normalized shape structure understood by comparison helpers.
Variants§
Any
The total AnyShape.
Atom(Symbol)
A symbol-bearing atomic shape.
And(Vec<ShapeNormalForm>)
Flattened conjunction.
Or(Vec<ShapeNormalForm>)
Flattened disjunction, including OneOfShape.
Not(Box<ShapeNormalForm>)
Complement of another normal form.
List
Fixed or variadic list structure.
Fields
§
items: Vec<ShapeNormalForm>Prefix item shapes.
§
rest: Option<Box<ShapeNormalForm>>Optional rest shape for variadic lists.
Table
Table fields and whether extra keys are rejected.
Fields
§
fields: Vec<(Symbol, ShapeNormalForm)>Named field shapes.
Repeat
Repeated collection body and bounds.
Fields
§
body: Box<ShapeNormalForm>Item shape.
Opaque
Shape with no exposed structure.
Trait Implementations§
Source§impl Clone for ShapeNormalKind
impl Clone for ShapeNormalKind
Source§fn clone(&self) -> ShapeNormalKind
fn clone(&self) -> ShapeNormalKind
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 moreSource§impl Debug for ShapeNormalKind
impl Debug for ShapeNormalKind
impl Eq for ShapeNormalKind
Source§impl PartialEq for ShapeNormalKind
impl PartialEq for ShapeNormalKind
Source§fn eq(&self, other: &ShapeNormalKind) -> bool
fn eq(&self, other: &ShapeNormalKind) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ShapeNormalKind
Auto Trait Implementations§
impl Freeze for ShapeNormalKind
impl RefUnwindSafe for ShapeNormalKind
impl Send for ShapeNormalKind
impl Sync for ShapeNormalKind
impl Unpin for ShapeNormalKind
impl UnsafeUnpin for ShapeNormalKind
impl UnwindSafe for ShapeNormalKind
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