Enum serde_content::Value
source · pub enum Value<'a> {
Unit,
Bool(bool),
Number(Number),
Char(char),
String(Cow<'a, str>),
Bytes(Cow<'a, [u8]>),
Seq(Vec<Value<'a>>),
Map(Vec<(Value<'a>, Value<'a>)>),
Option(Option<Box<Value<'a>>>),
Struct(Box<Struct<'a>>),
Enum(Box<Enum<'a>>),
Tuple(Vec<Value<'a>>),
}
Expand description
Represents any valid Rust value.
Variants§
Unit
Represents the Rust unit type, ()
.
Bool(bool)
Represents a Rust boolean.
Number(Number)
Represents any Rust number.
Char(char)
Represents a Rust character.
String(Cow<'a, str>)
Represents a Rust string.
Bytes(Cow<'a, [u8]>)
Represents a Rust byte array.
Seq(Vec<Value<'a>>)
Represents an array of Rust values.
Map(Vec<(Value<'a>, Value<'a>)>)
Represents a map of Rust values.
Option(Option<Box<Value<'a>>>)
Represents optional Rust values.
Struct(Box<Struct<'a>>)
Represents a Rust struct.
Enum(Box<Enum<'a>>)
Represents a Rust enum.
Tuple(Vec<Value<'a>>)
Represents a Rust tuple.
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Value<'static>
impl<'de> Deserialize<'de> for Value<'static>
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<'de> IntoDeserializer<'de, Error> for Value<'de>
impl<'de> IntoDeserializer<'de, Error> for Value<'de>
§type Deserializer = Deserializer<'de>
type Deserializer = Deserializer<'de>
The type of the deserializer being converted into.
source§fn into_deserializer(self) -> Self::Deserializer
fn into_deserializer(self) -> Self::Deserializer
Convert this value into a deserializer.
source§impl<'a> PartialOrd for Value<'a>
impl<'a> PartialOrd for Value<'a>
source§impl Unexpected for Value<'_>
impl Unexpected for Value<'_>
source§fn unexpected(self, expected: Expected) -> Error
fn unexpected(self, expected: Expected) -> Error
Consumes the type and returns an error.
impl<'a> StructuralPartialEq for Value<'a>
Auto Trait Implementations§
impl<'a> Freeze for Value<'a>
impl<'a> RefUnwindSafe for Value<'a>
impl<'a> Send for Value<'a>
impl<'a> Sync for Value<'a>
impl<'a> Unpin for Value<'a>
impl<'a> UnwindSafe for Value<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)