ValueExt

Trait ValueExt 

Source
pub trait ValueExt {
Show 26 methods // Required methods fn as_hs_coord(&self) -> Option<Coord>; fn as_hs_date(&self) -> Option<Date>; fn as_hs_date_time(&self) -> Option<DateTime>; fn as_hs_marker(&self) -> Option<Marker>; fn as_hs_na(&self) -> Option<Na>; fn as_hs_number(&self) -> Option<Number>; fn as_hs_ref(&self) -> Option<Ref>; fn as_hs_remove_marker(&self) -> Option<RemoveMarker>; fn as_hs_str(&self) -> Option<&str>; fn as_hs_symbol(&self) -> Option<Symbol>; fn as_hs_time(&self) -> Option<Time>; fn as_hs_uri(&self) -> Option<Uri>; fn as_hs_xstr(&self) -> Option<Xstr>; fn is_hs_coord(&self) -> bool; fn is_hs_date(&self) -> bool; fn is_hs_date_time(&self) -> bool; fn is_hs_marker(&self) -> bool; fn is_hs_na(&self) -> bool; fn is_hs_number(&self) -> bool; fn is_hs_ref(&self) -> bool; fn is_hs_remove_marker(&self) -> bool; fn is_hs_str(&self) -> bool; fn is_hs_symbol(&self) -> bool; fn is_hs_time(&self) -> bool; fn is_hs_uri(&self) -> bool; fn is_hs_xstr(&self) -> bool;
}
Expand description

An extension trait for the serde_json::Value enum, containing helper functions which make it easier to parse specific Haystack types from the underlying Hayson encoding (a JSON value in a specific format, see https://github.com/j2inn/hayson).

Required Methods§

Source

fn as_hs_coord(&self) -> Option<Coord>

Convert the JSON value to a Haystack Coord.

Source

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

Convert the JSON value to a Haystack Date.

Source

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

Convert the JSON value to a Haystack DateTime.

Source

fn as_hs_marker(&self) -> Option<Marker>

Convert the JSON value to a Haystack Marker.

Source

fn as_hs_na(&self) -> Option<Na>

Convert the JSON value to a Haystack NA.

Source

fn as_hs_number(&self) -> Option<Number>

Convert the JSON value to a Haystack Number.

Source

fn as_hs_ref(&self) -> Option<Ref>

Convert the JSON value to a Haystack Ref.

Source

fn as_hs_remove_marker(&self) -> Option<RemoveMarker>

Convert the JSON value to a Haystack Remove Marker.

Source

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

Parse the JSON value as a Haystack Str.

Source

fn as_hs_symbol(&self) -> Option<Symbol>

Convert the JSON value to a Haystack Symbol.

Source

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

Convert the JSON value to a Haystack Time.

Source

fn as_hs_uri(&self) -> Option<Uri>

Returns the Haystack URI value as a Haystack Uri.

Source

fn as_hs_xstr(&self) -> Option<Xstr>

Return the Haystack XStr value as a Haystack Xstr.

Source

fn is_hs_coord(&self) -> bool

Returns true if the JSON value represents a Haystack Coord.

Source

fn is_hs_date(&self) -> bool

Returns true if the JSON value represents a Haystack Date.

Source

fn is_hs_date_time(&self) -> bool

Returns true if the JSON value represents a Haystack DateTime.

Source

fn is_hs_marker(&self) -> bool

Returns true if the JSON value represents a Haystack marker.

Source

fn is_hs_na(&self) -> bool

Returns true if the JSON value represents a Haystack NA value.

Source

fn is_hs_number(&self) -> bool

Returns true if the JSON value represents a Haystack Number.

Source

fn is_hs_ref(&self) -> bool

Returns true if the JSON value represents a Haystack Ref.

Source

fn is_hs_remove_marker(&self) -> bool

Returns true if the JSON value represents a Haystack remove marker.

Source

fn is_hs_str(&self) -> bool

Returns true if the JSON value represents a Haystack Str.

Source

fn is_hs_symbol(&self) -> bool

Returns true if the JSON value represents a Haystack Symbol.

Source

fn is_hs_time(&self) -> bool

Returns true if the JSON value represents a Haystack Time.

Source

fn is_hs_uri(&self) -> bool

Returns true if the JSON value represents a Haystack URI.

Source

fn is_hs_xstr(&self) -> bool

Returns true if the JSON value represents a Haystack XStr.

Implementations on Foreign Types§

Source§

impl ValueExt for Value

Implementors§