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