pub enum ValueKind {
Nat(String),
Int(String),
Float(String),
Str(String),
Array(Vec<Value>),
Record(Vec<Member>),
Tagged {
name: String,
body: Option<TaggedBody>,
},
}Expand description
The kinds of a data value.
Variants§
Nat(String)
The literals keep their text, so that checking them against a type can decide how to interpret them.
An unsigned integer literal, such as 42.
Int(String)
A signed integer literal, such as +8 or -1.
Float(String)
A floating-point literal, such as 3.0 or -2.5e3.
Str(String)
A string literal, with its escapes decoded.
Array(Vec<Value>)
An array, such as [1, 2].
Record(Vec<Member>)
A record without a constructor, such as { x: 1 }.
Tagged
A constructor, optionally followed by a record, a tuple or an array, as in Quit, Move { x: 1 },
Write("hi") or Users[u1, u2].
A name that starts with a lower-case letter or _ is a reference to a const, which takes no body, and any other
name is a constructor.
Fields
§
body: Option<TaggedBody>What follows the name, or None if nothing does.
Trait Implementations§
impl Eq for ValueKind
impl StructuralPartialEq for ValueKind
Auto Trait Implementations§
impl Forget for ValueKind
impl Freeze for ValueKindwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<Member>: Freeze,
PhantomData<Argument>: Freeze,
impl Move for ValueKind
impl RefUnwindSafe for ValueKind
impl Send for ValueKindwhere
RawVecInner: Send,
impl Sync for ValueKindwhere
RawVecInner: Sync,
impl Unpin for ValueKind
impl UnsafeUnpin for ValueKindwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<Member>: UnsafeUnpin,
PhantomData<Argument>: UnsafeUnpin,
impl UnwindSafe for ValueKindwhere
RawVecInner: 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