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 PartialOrd for Variant
impl PartialOrd for Variant
impl Eq for Variant
impl StructuralPartialEq for Variant
Auto Trait Implementations§
impl Freeze for Variant
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.