pub enum ConstValue {
Int8(i8),
Int16(i16),
Int32(i32),
Int64(i64),
UInt8(u8),
UInt16(u16),
UInt32(u32),
UInt64(u64),
Bool(bool),
}Expand description
The value of a constant: a Rust integer of the constant’s own width
(int8 is an i8, uint/Address a u64, byte a u8), or a
bool. Nothing is widened: a value only ever meets a value of its own
width.
Variants§
Int8(i8)
An int8.
Int16(i16)
An int16.
Int32(i32)
An int32.
Int64(i64)
An int64, which int is.
UInt8(u8)
A uint8, which byte is.
UInt16(u16)
A uint16.
UInt32(u32)
A uint32.
UInt64(u64)
A uint64, which uint and Address are.
Bool(bool)
A bool.
Implementations§
Source§impl ConstValue
impl ConstValue
Trait Implementations§
Source§impl Clone for ConstValue
impl Clone for ConstValue
Source§fn clone(&self) -> ConstValue
fn clone(&self) -> ConstValue
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 ConstValue
impl Debug for ConstValue
Source§impl Display for ConstValue
impl Display for ConstValue
Source§impl From<bool> for ConstValue
impl From<bool> for ConstValue
Source§impl From<i16> for ConstValue
impl From<i16> for ConstValue
Source§impl From<i32> for ConstValue
impl From<i32> for ConstValue
Source§impl From<i64> for ConstValue
impl From<i64> for ConstValue
Source§impl From<i8> for ConstValue
impl From<i8> for ConstValue
Source§impl From<u16> for ConstValue
impl From<u16> for ConstValue
Source§impl From<u32> for ConstValue
impl From<u32> for ConstValue
Source§impl From<u64> for ConstValue
impl From<u64> for ConstValue
Source§impl From<u8> for ConstValue
impl From<u8> for ConstValue
Source§impl PartialEq for ConstValue
impl PartialEq for ConstValue
Source§fn eq(&self, other: &ConstValue) -> bool
fn eq(&self, other: &ConstValue) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ConstValue
impl Serialize for ConstValue
Source§impl TryFrom<ConstValue> for bool
impl TryFrom<ConstValue> for bool
Source§type Error = TryIntoError<ConstValue>
type Error = TryIntoError<ConstValue>
The type returned in the event of a conversion error.
Source§fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
Performs the conversion.
Source§impl TryFrom<ConstValue> for i16
impl TryFrom<ConstValue> for i16
Source§type Error = TryIntoError<ConstValue>
type Error = TryIntoError<ConstValue>
The type returned in the event of a conversion error.
Source§fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
Performs the conversion.
Source§impl TryFrom<ConstValue> for i32
impl TryFrom<ConstValue> for i32
Source§type Error = TryIntoError<ConstValue>
type Error = TryIntoError<ConstValue>
The type returned in the event of a conversion error.
Source§fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
Performs the conversion.
Source§impl TryFrom<ConstValue> for i64
impl TryFrom<ConstValue> for i64
Source§type Error = TryIntoError<ConstValue>
type Error = TryIntoError<ConstValue>
The type returned in the event of a conversion error.
Source§fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
Performs the conversion.
Source§impl TryFrom<ConstValue> for i8
impl TryFrom<ConstValue> for i8
Source§type Error = TryIntoError<ConstValue>
type Error = TryIntoError<ConstValue>
The type returned in the event of a conversion error.
Source§fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
Performs the conversion.
Source§impl TryFrom<ConstValue> for u16
impl TryFrom<ConstValue> for u16
Source§type Error = TryIntoError<ConstValue>
type Error = TryIntoError<ConstValue>
The type returned in the event of a conversion error.
Source§fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
Performs the conversion.
Source§impl TryFrom<ConstValue> for u32
impl TryFrom<ConstValue> for u32
Source§type Error = TryIntoError<ConstValue>
type Error = TryIntoError<ConstValue>
The type returned in the event of a conversion error.
Source§fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
Performs the conversion.
Source§impl TryFrom<ConstValue> for u64
impl TryFrom<ConstValue> for u64
Source§type Error = TryIntoError<ConstValue>
type Error = TryIntoError<ConstValue>
The type returned in the event of a conversion error.
Source§fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
Performs the conversion.
Source§impl TryFrom<ConstValue> for u8
impl TryFrom<ConstValue> for u8
Source§type Error = TryIntoError<ConstValue>
type Error = TryIntoError<ConstValue>
The type returned in the event of a conversion error.
Source§fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
fn try_from(value: ConstValue) -> Result<Self, TryIntoError<ConstValue>>
Performs the conversion.
impl Copy for ConstValue
impl Eq for ConstValue
impl StructuralPartialEq for ConstValue
Auto Trait Implementations§
impl Freeze for ConstValue
impl RefUnwindSafe for ConstValue
impl Send for ConstValue
impl Sync for ConstValue
impl Unpin for ConstValue
impl UnsafeUnpin for ConstValue
impl UnwindSafe for ConstValue
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.