#[non_exhaustive]pub enum VariantRepr<'a> {
External,
Internal {
tag: &'a str,
},
Adjacent {
tag: &'a str,
content: &'a str,
},
Untagged,
}Expand description
How an enum variant is represented.
This corresponds to the representations of the derive (see
derive).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
External
Externally tagged: unit variants are their name, others a map with the name as key and the content as value.
Internal
Internally tagged: a map with the name in the given key and the fields of the content.
Adjacent
Adjacently tagged: a map with the name and the content in the given keys.
Untagged
Untagged: just the content.
Trait Implementations§
Source§impl<'a> Clone for VariantRepr<'a>
impl<'a> Clone for VariantRepr<'a>
impl<'a> Copy for VariantRepr<'a>
Source§impl<'a> Debug for VariantRepr<'a>
impl<'a> Debug for VariantRepr<'a>
impl<'a> Eq for VariantRepr<'a>
Source§impl<'a> Hash for VariantRepr<'a>
impl<'a> Hash for VariantRepr<'a>
Source§impl<'a> PartialEq for VariantRepr<'a>
impl<'a> PartialEq for VariantRepr<'a>
impl<'a> StructuralPartialEq for VariantRepr<'a>
Auto Trait Implementations§
impl<'a> Freeze for VariantRepr<'a>
impl<'a> RefUnwindSafe for VariantRepr<'a>
impl<'a> Send for VariantRepr<'a>
impl<'a> Sync for VariantRepr<'a>
impl<'a> Unpin for VariantRepr<'a>
impl<'a> UnsafeUnpin for VariantRepr<'a>
impl<'a> UnwindSafe for VariantRepr<'a>
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.