pub enum LiteralClass {
Str,
ByteStr,
Byte,
Char,
Int,
Float,
Bool,
Any,
}
Expand description
Constrains for literal value type
Variants§
Str
Literal must be a string
ByteStr
Literal must be a byte string
Byte
Literal must be a byte (in form of b'f'
)
Char
Literal must be a character
Int
Literal must be an integer
Float
Literal must be a float
Bool
Literal must be a boolean
Any
Literal must be a verbatim form
Implementations§
Trait Implementations§
Source§impl Clone for LiteralClass
impl Clone for LiteralClass
Source§fn clone(&self) -> LiteralClass
fn clone(&self) -> LiteralClass
Returns a duplicate of the value. Read more
1.0.0 · 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 LiteralClass
impl Debug for LiteralClass
Source§impl From<&Lit> for LiteralClass
impl From<&Lit> for LiteralClass
Source§impl From<Lit> for LiteralClass
impl From<Lit> for LiteralClass
Source§impl From<LiteralClass> for ValueClass
impl From<LiteralClass> for ValueClass
Source§fn from(cls: LiteralClass) -> Self
fn from(cls: LiteralClass) -> Self
Converts to this type from the input type.
Source§impl Hash for LiteralClass
impl Hash for LiteralClass
Source§impl Ord for LiteralClass
impl Ord for LiteralClass
Source§fn cmp(&self, other: &LiteralClass) -> Ordering
fn cmp(&self, other: &LiteralClass) -> 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 LiteralClass
impl PartialEq for LiteralClass
Source§impl PartialOrd for LiteralClass
impl PartialOrd for LiteralClass
impl Copy for LiteralClass
impl Eq for LiteralClass
impl StructuralPartialEq for LiteralClass
Auto Trait Implementations§
impl Freeze for LiteralClass
impl RefUnwindSafe for LiteralClass
impl Send for LiteralClass
impl Sync for LiteralClass
impl Unpin for LiteralClass
impl UnwindSafe for LiteralClass
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
Str
: 0 bytesByteStr
: 0 bytesByte
: 0 bytesChar
: 0 bytesInt
: 0 bytesFloat
: 0 bytesBool
: 0 bytesAny
: 0 bytes