pub struct Discriminant {
pub expr: String,
pub value: String,
}
Expand description
The value that distinguishes a variant in an Enum
from other variants.
Fields§
§expr: String
The expression that produced the discriminant.
Unlike value
, this preserves the original formatting (eg suffixes,
hexadecimal, and underscores), making it unsuitable to be machine
interpreted.
In some cases, when the value is too complex, this may be "{ _ }"
.
When this occurs is unstable, and may change without notice.
value: String
The numerical value of the discriminant. Stored as a string due to
JSON’s poor support for large integers, and the fact that it would need
to store from i128::MIN
to u128::MAX
.
Trait Implementations§
source§impl Clone for Discriminant
impl Clone for Discriminant
source§fn clone(&self) -> Discriminant
fn clone(&self) -> Discriminant
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Discriminant
impl Debug for Discriminant
source§impl<'de> Deserialize<'de> for Discriminant
impl<'de> Deserialize<'de> for Discriminant
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Hash for Discriminant
impl Hash for Discriminant
source§impl PartialEq for Discriminant
impl PartialEq for Discriminant
source§impl Serialize for Discriminant
impl Serialize for Discriminant
impl Eq for Discriminant
impl StructuralPartialEq for Discriminant
Auto Trait Implementations§
impl Freeze for Discriminant
impl RefUnwindSafe for Discriminant
impl Send for Discriminant
impl Sync for Discriminant
impl Unpin for Discriminant
impl UnwindSafe for Discriminant
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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: 48 bytes