pub type StaticValue = Value<'static>;Expand description
A Value with static lifetime for borrowed data (strings, bytes).
See Static strings for more info.
Aliased Type§
pub enum StaticValue {
Show 30 variants
Bool(bool),
I8(i8),
I16(i16),
I32(i32),
I64(i64),
I128(i128),
U8(u8),
U16(u16),
U32(u32),
U64(u64),
U128(u128),
F32(f32),
F64(f64),
Char(char),
Str(Cow<'static, str>),
Bytes(Cow<'static, [u8]>),
Unit,
Some,
None,
UnitStruct(&'static str),
UnitVariant {
name: &'static str,
variant_index: u32,
variant: &'static str,
},
NewtypeStruct(&'static str),
NewtypeVariant {
name: &'static str,
variant_index: u32,
variant: &'static str,
},
Seq(Option<usize>),
Tuple(usize),
TupleStruct {
name: &'static str,
len: usize,
},
TupleVariant {
name: &'static str,
variant_index: u32,
variant: &'static str,
len: usize,
},
Map(Option<usize>),
Struct {
name: &'static str,
len: usize,
},
StructVariant {
name: &'static str,
variant_index: u32,
variant: &'static str,
len: usize,
},
}Variants§
Bool(bool)
bool value
I8(i8)
i8 value
I16(i16)
i16 value
I32(i32)
i32 value
I64(i64)
i64 value
I128(i128)
i128 value
U8(u8)
u8 value
U16(u16)
u16 value
U32(u32)
u32 value
U64(u64)
u64 value
U128(u128)
u128 value
F32(f32)
f32 value
F64(f64)
f64 value
Char(char)
char value
Str(Cow<'static, str>)
String value, borrowed or owned.
Bytes(Cow<'static, [u8]>)
Bytes value, borrowed or owned.
Note that you need to use serde_bytes or do custom (de)serialization
in order to get bytes value as a [u8] slice instead of a sequence.
Unit
Unit value, i.e. ().
Some
Metadata (marker) for a value of Option<T>::Some(...).
During serialization, the actual value contained in the Option is serialized
in the follow up calls to the serializer. This metadata can thus be seen as a marker,
telling that the actual value serialization will follow.
None
Metadata (marker) for a value of Option<T>::None.
UnitStruct(&'static str)
Metadata for a value of unit struct type (e.g. struct Unit).
UnitVariant
Metadata for a value of unit variant type (e.g. E::A in enum E { A, B }).
Fields
NewtypeStruct(&'static str)
Metadata for a value of newtype struct (e.g. struct Millimeters(u8)).
NewtypeVariant
Metadata for a value of unit variant type (e.g. E::N in enum E { N(u8) }).
Fields
Seq(Option<usize>)
Metadata for a value of sequence type (e.g. Vec<T> or HashSet<T>).
Tuple(usize)
Metadata for a value of tuple type.
Tuple Fields
TupleStruct
Metadata for a value of tuple struct type (e.g. struct Rgb(u8, u8, u8)).
Fields
TupleVariant
Metadata for a value of tuple variant type (e.g. E::T in enum E { T(u8, u8) }).
Fields
variant_index: u32Variant index in the enum.
For example, this would be 0 for E::T in enum E { T(u8, u8) }.
Map(Option<usize>)
Metadata for a value of map type (e.g. BTreeMap<K, V>).
Struct
Metadata for a value of struct type (e.g. struct S { r: u8, g: u8, b: u8 }).
Fields
StructVariant
Metadata for a value of struct variant type (e.g. E::S in enum E { S { r: u8, g: u8, b: u8 } }).
Fields
name: &'static strEnum name.
For example, this would be "E" in enum E { S { r: u8, g: u8, b: u8 } }.
variant_index: u32Variant index in the enum.
For example, this would be 0 for E::S in enum E { S { r: u8, g: u8, b: u8 } }.