pub enum Json {
Null,
Bool(bool),
Int(i64),
Float(f64),
String(String),
Array(Vec<Json>),
Object(Vec<(String, Json)>),
}Variants§
Implementations§
Source§impl Json
impl Json
pub fn parse(text: &str) -> Result<Json>
pub fn str(text: impl Into<String>) -> Json
pub fn object(pairs: Vec<(&str, Json)>) -> Json
pub fn get(&self, key: &str) -> Option<&Json>
pub fn as_str(&self) -> Option<&str>
pub fn as_i64(&self) -> Option<i64>
pub fn as_f64(&self) -> Option<f64>
pub fn is_null(&self) -> bool
Sourcepub fn as_list(&self) -> Vec<&Json>
pub fn as_list(&self) -> Vec<&Json>
One object or a list of them, as a list: GraphQL coerces a single value to a list of one, and DeepClient relies on it.
pub fn write(&self) -> String
Trait Implementations§
impl StructuralPartialEq for Json
Auto Trait Implementations§
impl Forget for Json
impl Freeze for Jsonwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Json>: Freeze,
PhantomData<(String, Json)>: Freeze,
impl Move for Json
impl RefUnwindSafe for Json
impl Send for Jsonwhere
RawVecInner: Send,
impl Sync for Jsonwhere
RawVecInner: Sync,
impl Unpin for Json
impl UnsafeUnpin for Jsonwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Json>: UnsafeUnpin,
PhantomData<(String, Json)>: UnsafeUnpin,
impl UnwindSafe for Jsonwhere
RawVecInner: UnwindSafe,
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