pub enum Plain {
Undefined,
Null,
Bool(bool),
Number(f64),
String(Rc<str>),
Array(Vec<Plain>),
Object(PlainObject),
}Variants§
Implementations§
Source§impl Plain
impl Plain
pub fn object() -> Self
Sourcepub fn is_nullish(&self) -> bool
pub fn is_nullish(&self) -> bool
value == null
pub fn as_f64(&self) -> Option<f64>
pub fn as_str(&self) -> Option<&str>
pub fn as_bool(&self) -> Option<bool>
pub fn as_array(&self) -> Option<&Vec<Plain>>
pub fn as_object(&self) -> Option<&PlainObject>
pub fn as_object_mut(&mut self) -> Option<&mut PlainObject>
Trait Implementations§
Source§impl From<PlainObject> for Plain
impl From<PlainObject> for Plain
Source§fn from(o: PlainObject) -> Self
fn from(o: PlainObject) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Plain
Auto Trait Implementations§
impl !Send for Plain
impl !Sync for Plain
impl Forget for Plain
impl Freeze for Plain
impl Move for Plain
impl RefUnwindSafe for Plain
impl Unpin for Plain
impl UnsafeUnpin for Plain
impl UnwindSafe for Plain
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