pub enum Representation {
External,
Internal {
tag: String,
},
Adjacent {
tag: String,
content: String,
},
None,
}
Variants§
External
The default.
{"variant1": {"key1": "value1", "key2": "value2"}}
Internal
#[serde(tag = "type")]
{"type": "variant1", "key1": "value1", "key2": "value2"}
Adjacent
#[serde(tag = "t", content = "c")]
{"t": "variant1", "c": {"key1": "value1", "key2": "value2"}}
None
#[serde(untagged)]
{"key1": "value1", "key2": "value2"}
Implementations§
source§impl Representation
impl Representation
pub fn new() -> Self
pub fn is_default(&self) -> bool
pub fn is_external(&self) -> bool
pub fn is_internal(&self) -> bool
pub fn is_adjacent(&self) -> bool
pub fn is_none(&self) -> bool
Trait Implementations§
source§impl Clone for Representation
impl Clone for Representation
source§fn clone(&self) -> Representation
fn clone(&self) -> Representation
Returns a copy of the value. Read more
1.0.0 · 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 Representation
impl Debug for Representation
source§impl Default for Representation
impl Default for Representation
source§impl<'de> Deserialize<'de> for Representation
impl<'de> Deserialize<'de> for Representation
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for Representation
impl Hash for Representation
source§impl PartialEq for Representation
impl PartialEq for Representation
source§fn eq(&self, other: &Representation) -> bool
fn eq(&self, other: &Representation) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Representation
impl Serialize for Representation
impl Eq for Representation
impl StructuralPartialEq for Representation
Auto Trait Implementations§
impl Freeze for Representation
impl RefUnwindSafe for Representation
impl Send for Representation
impl Sync for Representation
impl Unpin for Representation
impl UnwindSafe for Representation
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