Enum serde_intermediate::value::object::Variant
source · pub enum Variant {
Unit,
Wrapper(Box<Object>),
Array(Vec<Object>),
Map(Vec<(String, Object)>),
}
Variants§
Implementations§
source§impl Variant
impl Variant
pub fn unit() -> Self
pub fn wrapper(value: impl Into<Object>) -> Self
pub fn array() -> Self
pub fn array_from<T: Into<Object>>(value: impl IntoIterator<Item = T>) -> Self
pub fn item(self, value: impl Into<Object>) -> Self
pub fn map() -> Self
pub fn map_from<K: ToString, V: Into<Object>>( value: impl IntoIterator<Item = (K, V)> ) -> Self
pub fn property(self, key: impl ToString, value: impl Into<Object>) -> Self
pub fn as_unit(&self) -> Option<()>
pub fn as_wrapper(&self) -> Option<&Object>
pub fn as_array(&self) -> Option<&[Object]>
pub fn as_map(&self) -> Option<&[(String, Object)]>
Trait Implementations§
source§impl PartialEq<Variant> for Variant
impl PartialEq<Variant> for Variant
source§impl PartialOrd<Variant> for Variant
impl PartialOrd<Variant> for Variant
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Variant
impl StructuralEq for Variant
impl StructuralPartialEq for Variant
Auto Trait Implementations§
impl RefUnwindSafe for Variant
impl Send for Variant
impl Sync for Variant
impl Unpin for Variant
impl UnwindSafe for Variant
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.