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§
Source§impl<'de> Deserialize<'de> for Format
impl<'de> Deserialize<'de> for Format
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 FormatHolder for Format
impl FormatHolder for Format
Source§fn 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.
Source§fn 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.Source§fn 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 moreSource§fn 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 StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl !RefUnwindSafe for Format
impl !Send for Format
impl !Sync for Format
impl Unpin for Format
impl !UnwindSafe for Format
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