Enum serde_reflection::Format
source · [−]pub enum Format {
Show 24 variants
Variable(Variable<Format>),
TypeName(String),
Unit,
Bool,
I8,
I16,
I32,
I64,
I128,
U8,
U16,
U32,
U64,
U128,
F32,
F64,
Char,
Str,
Bytes,
Option(Box<Format>),
Seq(Box<Format>),
Map {
key: Box<Format>,
value: Box<Format>,
},
Tuple(Vec<Format>),
TupleArray {
content: Box<Format>,
size: usize,
},
}
Expand description
Serde-based serialization format for anonymous “value” types.
Variants
Variable(Variable<Format>)
A format whose value is initially unknown. Used internally for tracing. Not (de)serializable.
TypeName(String)
The name of a container.
Unit
Bool
I8
I16
I32
I64
I128
U8
U16
U32
U64
U128
F32
F64
Char
Str
Bytes
Option(Box<Format>)
The format of Option<T>
.
Seq(Box<Format>)
A sequence, e.g. the format of Vec<Foo>
.
Map
A map, e.g. the format of BTreeMap<K, V>
.
Tuple(Vec<Format>)
A tuple, e.g. the format of (Foo, Bar)
.
TupleArray
Alias for (Foo, ... Foo)
.
E.g. the format of [Foo; N]
.
Implementations
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Format
impl<'de> Deserialize<'de> for Format
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 Format
impl FormatHolder for Format
sourcefn unify(&mut self, format: Format) -> Result<()>
fn unify(&mut self, format: Format) -> Result<()>
Unify the newly “traced” value format
into the current format.
Note that there should be no TupleArray
s at this point.
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 is_unknown(&self) -> bool
fn is_unknown(&self) -> bool
Whether this format is a variable with no known value yet.
impl Eq for Format
impl StructuralEq for Format
impl StructuralPartialEq for Format
Auto Trait Implementations
impl !RefUnwindSafe for Format
impl !Send for Format
impl !Sync for Format
impl Unpin for Format
impl !UnwindSafe for Format
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