[][src]Trait json_trait_rs::JsonType

pub trait JsonType<T>: Debug where
    T: JsonType<T> + Into<RustType>, 
{ fn as_array<'json>(
        &'json self
    ) -> Option<Box<dyn ExactSizeIterator<Item = &T> + 'json>>;
fn as_boolean(&self) -> Option<bool>;
fn as_integer(&self) -> Option<i128>;
fn as_null(&self) -> Option<()>;
fn as_number(&self) -> Option<f64>;
fn as_object(&self) -> Option<JsonMap<T>>
    where
        JsonMap<'json, T>: JsonMapTrait<'json, T>
;
fn as_string(&self) -> Option<&str>;
fn get_attribute(&self, attribute_name: &str) -> Option<&T>;
fn get_index(&self, index: usize) -> Option<&T>; fn is_array(&self) -> bool { ... }
fn is_boolean(&self) -> bool { ... }
fn is_integer(&self) -> bool { ... }
fn is_null(&self) -> bool { ... }
fn is_number(&self) -> bool { ... }
fn is_object(&self) -> bool
    where
        JsonMap<'json, T>: JsonMapTrait<'json, T>
, { ... }
fn is_string(&self) -> bool { ... }
fn has_attribute(&self, attribute_name: &str) -> bool { ... }
fn primitive_type(&self) -> PrimitiveType
    where
        JsonMap<'json, T>: JsonMapTrait<'json, T>
, { ... }
fn to_rust_type(&self) -> RustType
    where
        JsonMap<'json, T>: JsonMapTrait<'json, T>
, { ... } }

Required methods

fn as_array<'json>(
    &'json self
) -> Option<Box<dyn ExactSizeIterator<Item = &T> + 'json>>

fn as_boolean(&self) -> Option<bool>

fn as_integer(&self) -> Option<i128>

fn as_null(&self) -> Option<()>

fn as_number(&self) -> Option<f64>

fn as_object(&self) -> Option<JsonMap<T>> where
    JsonMap<'json, T>: JsonMapTrait<'json, T>, 

fn as_string(&self) -> Option<&str>

fn get_attribute(&self, attribute_name: &str) -> Option<&T>

fn get_index(&self, index: usize) -> Option<&T>

Loading content...

Provided methods

fn is_array(&self) -> bool

fn is_boolean(&self) -> bool

fn is_integer(&self) -> bool

fn is_null(&self) -> bool

fn is_number(&self) -> bool

fn is_object(&self) -> bool where
    JsonMap<'json, T>: JsonMapTrait<'json, T>, 

fn is_string(&self) -> bool

fn has_attribute(&self, attribute_name: &str) -> bool

fn primitive_type(&self) -> PrimitiveType where
    JsonMap<'json, T>: JsonMapTrait<'json, T>, 

fn to_rust_type(&self) -> RustType where
    JsonMap<'json, T>: JsonMapTrait<'json, T>, 

Loading content...

Implementations on Foreign Types

impl JsonType<JsonValue> for JsonValue[src]

impl JsonType<PyAny> for PyAny[src]

impl JsonType<Value> for Value[src]

impl JsonType<Value> for Value[src]

Loading content...

Implementors

impl JsonType<RustType> for RustType[src]

Loading content...