Enum serde_reflection::ContainerFormat
source · [−]pub enum ContainerFormat {
UnitStruct,
NewTypeStruct(Box<Format>),
TupleStruct(Vec<Format>),
Struct(Vec<Named<Format>>),
Enum(BTreeMap<u32, Named<VariantFormat>>),
}
Expand description
Serde-based serialization format for named “container” types. In Rust, those are enums and structs.
Variants
UnitStruct
An empty struct, e.g. struct A
.
NewTypeStruct(Box<Format>)
A struct with a single unnamed parameter, e.g. struct A(u16)
TupleStruct(Vec<Format>)
A struct with several unnamed parameters, e.g. struct A(u16, u32)
Struct(Vec<Named<Format>>)
A struct with named parameters, e.g. struct A { a: Foo }
.
Enum(BTreeMap<u32, Named<VariantFormat>>)
An enum, that is, an enumeration of variants. Each variant has a unique name and index within the enum.
Trait Implementations
sourceimpl Clone for ContainerFormat
impl Clone for ContainerFormat
sourcefn clone(&self) -> ContainerFormat
fn clone(&self) -> ContainerFormat
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ContainerFormat
impl Debug for ContainerFormat
sourceimpl<'de> Deserialize<'de> for ContainerFormat
impl<'de> Deserialize<'de> for ContainerFormat
sourcefn 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
sourceimpl FormatHolder for ContainerFormat
impl FormatHolder for ContainerFormat
sourcefn visit<'a>(
&'a self,
f: &mut dyn FnMut(&'a Format) -> Result<()>
) -> Result<()>
fn visit<'a>(
&'a self,
f: &mut dyn FnMut(&'a Format) -> Result<()>
) -> Result<()>
Visit all the formats in self
in a depth-first way.
Variables are not supported and will cause an error. Read more
sourcefn visit_mut(
&mut self,
f: &mut dyn FnMut(&mut Format) -> Result<()>
) -> Result<()>
fn visit_mut(
&mut self,
f: &mut dyn FnMut(&mut Format) -> Result<()>
) -> Result<()>
Mutably visit all the formats in self
in a depth-first way. Read more
sourcefn unify(&mut self, format: ContainerFormat) -> Result<()>
fn unify(&mut self, format: ContainerFormat) -> Result<()>
Update variables and add missing enum variants so that the terms match. This is a special case of term unification: Read more
sourcefn is_unknown(&self) -> bool
fn is_unknown(&self) -> bool
Whether this format is a variable with no known value yet.
sourceimpl PartialEq<ContainerFormat> for ContainerFormat
impl PartialEq<ContainerFormat> for ContainerFormat
sourcefn eq(&self, other: &ContainerFormat) -> bool
fn eq(&self, other: &ContainerFormat) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ContainerFormat) -> bool
fn ne(&self, other: &ContainerFormat) -> bool
This method tests for !=
.
sourceimpl Serialize for ContainerFormat
impl Serialize for ContainerFormat
impl Eq for ContainerFormat
impl StructuralEq for ContainerFormat
impl StructuralPartialEq for ContainerFormat
Auto Trait Implementations
impl !RefUnwindSafe for ContainerFormat
impl !Send for ContainerFormat
impl !Sync for ContainerFormat
impl Unpin for ContainerFormat
impl !UnwindSafe for ContainerFormat
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more