pub enum ValueClass {
Literal(LiteralClass),
Type(TypeClass),
Expr,
}
Expand description
Constrains for attribute value type
Variants§
Literal(LiteralClass)
The value must be a literal matching given literal constraints (see
LiteralClass
)
Type(TypeClass)
The value must be of a native rust type matching given type constraints
(see TypeClass
)
Expr
The value must be of a native rust expression.
Implementations§
Source§impl ValueClass
impl ValueClass
Sourcepub fn str() -> ValueClass
pub fn str() -> ValueClass
Convenience constructor creating
ValueClass::Literal(LiteralClass::Str)
Sourcepub fn byte_str() -> ValueClass
pub fn byte_str() -> ValueClass
Convenience constructor creating
ValueClass::Literal(LiteralClass::ByteStr)
Sourcepub fn byte() -> ValueClass
pub fn byte() -> ValueClass
Convenience constructor creating
ValueClass::Literal(LiteralClass::Byte)
Sourcepub fn int() -> ValueClass
pub fn int() -> ValueClass
Convenience constructor creating
ValueClass::Literal(LiteralClass::Int)
Sourcepub fn float() -> ValueClass
pub fn float() -> ValueClass
Convenience constructor creating
ValueClass::Literal(LiteralClass::Float)
Sourcepub fn char() -> ValueClass
pub fn char() -> ValueClass
Convenience constructor creating
ValueClass::Literal(LiteralClass::Char)
Sourcepub fn bool() -> ValueClass
pub fn bool() -> ValueClass
Convenience constructor creating
ValueClass::Literal(LiteralClass::Bool)
Trait Implementations§
Source§impl Clone for ValueClass
impl Clone for ValueClass
Source§fn clone(&self) -> ValueClass
fn clone(&self) -> ValueClass
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ValueClass
impl Debug for ValueClass
Source§impl From<&Lit> for ValueClass
impl From<&Lit> for ValueClass
Source§impl From<&Type> for ValueClass
impl From<&Type> for ValueClass
Source§impl From<Lit> for ValueClass
impl From<Lit> for ValueClass
Source§impl From<LiteralClass> for ValueClass
impl From<LiteralClass> for ValueClass
Source§fn from(cls: LiteralClass) -> Self
fn from(cls: LiteralClass) -> Self
Source§impl From<Type> for ValueClass
impl From<Type> for ValueClass
Source§impl From<TypeClass> for ValueClass
impl From<TypeClass> for ValueClass
Source§impl Hash for ValueClass
impl Hash for ValueClass
Source§impl Ord for ValueClass
impl Ord for ValueClass
Source§fn cmp(&self, other: &ValueClass) -> Ordering
fn cmp(&self, other: &ValueClass) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ValueClass
impl PartialEq for ValueClass
Source§impl PartialOrd for ValueClass
impl PartialOrd for ValueClass
impl Copy for ValueClass
impl Eq for ValueClass
impl StructuralPartialEq for ValueClass
Auto Trait Implementations§
impl Freeze for ValueClass
impl RefUnwindSafe for ValueClass
impl Send for ValueClass
impl Sync for ValueClass
impl Unpin for ValueClass
impl UnwindSafe for ValueClass
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
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: 2 bytes
Size for each variant:
Literal
: 1 byteType
: 1 byteExpr
: 0 bytes