#[repr(u8)]pub enum JsonType {
Null = 0,
Boolean = 1,
Number = 2,
String = 3,
Object = 4,
Array = 5,
}
Expand description
JsonType is an enum that represents the type of a JSON value.
§Examples
use sonic_rs::{JsonType, JsonValueTrait, Value};
let json: Value = sonic_rs::from_str(r#"{"a": 1, "b": true}"#).unwrap();
assert_eq!(json.get(&"a").unwrap().get_type(), JsonType::Number);
Variants§
Trait Implementations§
impl Copy for JsonType
impl Eq for JsonType
impl StructuralPartialEq for JsonType
Auto Trait Implementations§
impl Freeze for JsonType
impl RefUnwindSafe for JsonType
impl Send for JsonType
impl Sync for JsonType
impl Unpin for JsonType
impl UnwindSafe for JsonType
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)