Type Alias zino_core::JsonValue

source ·
pub type JsonValue = Value;
Expand description

A JSON value.

Aliased Type§

enum JsonValue {
    // some variants omitted
}

Variants§

Trait Implementations§

source§

impl From<Date> for JsonValue

source§

fn from(d: Date) -> Self

Converts to this type from the input type.
source§

impl From<DateTime> for JsonValue

source§

fn from(dt: DateTime) -> Self

Converts to this type from the input type.
source§

impl From<Time> for JsonValue

source§

fn from(t: Time) -> Self

Converts to this type from the input type.
source§

impl JsonValueExt for JsonValue

source§

fn is_ignorable(&self) -> bool

Returns true if the JSON value can be ignored.
source§

fn as_u8(&self) -> Option<u8>

If the Value is an integer, represent it as u8 if possible. Returns None otherwise.
source§

fn as_u16(&self) -> Option<u16>

If the Value is an integer, represent it as u16 if possible. Returns None otherwise.
source§

fn as_u32(&self) -> Option<u32>

If the Value is an integer, represent it as u32 if possible. Returns None otherwise.
source§

fn as_usize(&self) -> Option<usize>

If the Value is an integer, represent it as usize if possible. Returns None otherwise.
source§

fn as_i8(&self) -> Option<i8>

If the Value is an integer, represent it as i8 if possible. Returns None otherwise.
source§

fn as_i16(&self) -> Option<i16>

If the Value is an integer, represent it as i16 if possible. Returns None otherwise.
source§

fn as_i32(&self) -> Option<i32>

If the Value is an integer, represent it as i32 if possible. Returns None otherwise.
source§

fn as_isize(&self) -> Option<isize>

If the Value is an integer, represent it as isize if possible. Returns None otherwise.
source§

fn as_f32(&self) -> Option<f32>

If the Value is a float, represent it as f32 if possible. Returns None otherwise.
source§

fn as_str_array(&self) -> Option<Vec<&str>>

If the Value is an array of strings, returns the associated vector. Returns None otherwise.
source§

fn as_map_array(&self) -> Option<Vec<&Map>>

If the Value is an array of maps, returns the associated vector. Returns None otherwise.
source§

fn as_uuid(&self) -> Option<Uuid>

If the Value is a String, represent it as Uuid if possible. Returns None otherwise.
source§

fn as_date(&self) -> Option<Date>

If the Value is a String, represent it as Date if possible. Returns None otherwise.
source§

fn as_time(&self) -> Option<Time>

If the Value is a String, represent it as Time if possible. Returns None otherwise.
source§

fn as_datetime(&self) -> Option<DateTime>

If the Value is a String, represent it as DateTime if possible. Returns None otherwise.
source§

fn as_duration(&self) -> Option<Duration>

If the Value is a String, represent it as Duration if possible. Returns None otherwise.
source§

fn parse_bool(&self) -> Option<Result<bool, ParseBoolError>>

Parses the JSON value as bool.
source§

fn parse_u8(&self) -> Option<Result<u8, ParseIntError>>

Parses the JSON value as u8.
source§

fn parse_u16(&self) -> Option<Result<u16, ParseIntError>>

Parses the JSON value as u16.
source§

fn parse_u32(&self) -> Option<Result<u32, ParseIntError>>

Parses the JSON value as u32.
source§

fn parse_u64(&self) -> Option<Result<u64, ParseIntError>>

Parses the JSON value as u64.
source§

fn parse_usize(&self) -> Option<Result<usize, ParseIntError>>

Parses the JSON value as usize.
source§

fn parse_i8(&self) -> Option<Result<i8, ParseIntError>>

Parses the JSON value as i8.
source§

fn parse_i16(&self) -> Option<Result<i16, ParseIntError>>

Parses the JSON value as i16.
source§

fn parse_i32(&self) -> Option<Result<i32, ParseIntError>>

Parses the JSON value as i32.
source§

fn parse_i64(&self) -> Option<Result<i64, ParseIntError>>

Parses the JSON value as i64.
source§

fn parse_isize(&self) -> Option<Result<isize, ParseIntError>>

Parses the JSON value as isize.
source§

fn parse_f32(&self) -> Option<Result<f32, ParseFloatError>>

Parses the JSON value as f32.
source§

fn parse_f64(&self) -> Option<Result<f64, ParseFloatError>>

Parses the JSON value as f64.
source§

fn parse_string(&self) -> Option<Cow<'_, str>>

Parses the JSON value as Cow<'_, str>. If the str is empty, it also returns None.
source§

fn parse_array<T: FromStr>(&self) -> Option<Result<Vec<T>, <T as FromStr>::Err>>

Parses the JSON value as Vec<T>. If the vec is empty, it also returns None.
source§

fn parse_str_array(&self) -> Option<Vec<&str>>

Parses the JSON value as Vec<&str>. If the vec is empty, it also returns None.
source§

fn parse_uuid(&self) -> Option<Result<Uuid, Error>>

Parses the JSON value as Uuid. If the Uuid is nil, it also returns None.
source§

fn parse_decimal(&self) -> Option<Result<Decimal, Error>>

Parses the JSON value as Decimal.
source§

fn parse_date(&self) -> Option<Result<Date, ParseError>>

Parses the JSON value as Date.
source§

fn parse_time(&self) -> Option<Result<Time, ParseError>>

Parses the JSON value as Time.
source§

fn parse_datetime(&self) -> Option<Result<DateTime, ParseError>>

Parses the JSON value as DateTime.
source§

fn parse_duration(&self) -> Option<Result<Duration, ParseDurationError>>

Parses the JSON value as Duration.
source§

fn to_string_pretty(&self) -> String

Returns a pretty-printed String of JSON.
source§

fn to_string_unquoted(&self) -> String

Returns a unquoted String of JSON.
source§

fn to_csv(&self, buffer: Vec<u8>) -> Result<Vec<u8>, Error>

Attempts to convert the JSON value to the CSV bytes.
source§

fn to_jsonlines(&self, buffer: Vec<u8>) -> Result<Vec<u8>, Error>

Attempts to convert the JSON value to the JSON Lines bytes.
source§

fn deserialize<T: DeserializeOwned>(self) -> Result<T, Error>

Attempts to deserialize the JSON value as an instance of type T.
source§

fn into_map_array(self) -> Vec<Map>

Converts self into a map array.
source§

fn into_map_opt(self) -> Option<Map>

Converts self into a map option.