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§
Sourcefn as_hs_coord(&self) -> Option<Coord>
fn as_hs_coord(&self) -> Option<Coord>
Convert the JSON value to a Haystack Coord.
Sourcefn as_hs_date(&self) -> Option<Date>
fn as_hs_date(&self) -> Option<Date>
Convert the JSON value to a Haystack Date.
Sourcefn as_hs_date_time(&self) -> Option<DateTime>
fn as_hs_date_time(&self) -> Option<DateTime>
Convert the JSON value to a Haystack DateTime.
Sourcefn as_hs_marker(&self) -> Option<Marker>
fn as_hs_marker(&self) -> Option<Marker>
Convert the JSON value to a Haystack Marker.
Sourcefn as_hs_number(&self) -> Option<Number>
fn as_hs_number(&self) -> Option<Number>
Convert the JSON value to a Haystack Number.
Sourcefn as_hs_remove_marker(&self) -> Option<RemoveMarker>
fn as_hs_remove_marker(&self) -> Option<RemoveMarker>
Convert the JSON value to a Haystack Remove Marker.
Sourcefn as_hs_symbol(&self) -> Option<Symbol>
fn as_hs_symbol(&self) -> Option<Symbol>
Convert the JSON value to a Haystack Symbol.
Sourcefn as_hs_time(&self) -> Option<Time>
fn as_hs_time(&self) -> Option<Time>
Convert the JSON value to a Haystack Time.
Sourcefn as_hs_xstr(&self) -> Option<Xstr>
fn as_hs_xstr(&self) -> Option<Xstr>
Return the Haystack XStr value as a Haystack Xstr.
Sourcefn is_hs_coord(&self) -> bool
fn is_hs_coord(&self) -> bool
Returns true if the JSON value represents a Haystack Coord.
Sourcefn is_hs_date(&self) -> bool
fn is_hs_date(&self) -> bool
Returns true if the JSON value represents a Haystack Date.
Sourcefn is_hs_date_time(&self) -> bool
fn is_hs_date_time(&self) -> bool
Returns true if the JSON value represents a Haystack DateTime.
Sourcefn is_hs_marker(&self) -> bool
fn is_hs_marker(&self) -> bool
Returns true if the JSON value represents a Haystack marker.
Sourcefn is_hs_number(&self) -> bool
fn is_hs_number(&self) -> bool
Returns true if the JSON value represents a Haystack Number.
Sourcefn is_hs_remove_marker(&self) -> bool
fn is_hs_remove_marker(&self) -> bool
Returns true if the JSON value represents a Haystack remove marker.
Sourcefn is_hs_symbol(&self) -> bool
fn is_hs_symbol(&self) -> bool
Returns true if the JSON value represents a Haystack Symbol.
Sourcefn is_hs_time(&self) -> bool
fn is_hs_time(&self) -> bool
Returns true if the JSON value represents a Haystack Time.
Sourcefn is_hs_xstr(&self) -> bool
fn is_hs_xstr(&self) -> bool
Returns true if the JSON value represents a Haystack XStr.