Trait raystack::ValueExt [−][src]
pub trait ValueExt {
Show 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
fn as_hs_coord(&self) -> Option<Coord>
fn as_hs_coord(&self) -> Option<Coord>Convert the JSON value to a Haystack Coord.
fn as_hs_date(&self) -> Option<Date>
fn as_hs_date(&self) -> Option<Date>Convert the JSON value to a Haystack Date.
fn as_hs_date_time(&self) -> Option<DateTime>
fn as_hs_date_time(&self) -> Option<DateTime>Convert the JSON value to a Haystack DateTime.
fn as_hs_marker(&self) -> Option<Marker>
fn as_hs_marker(&self) -> Option<Marker>Convert the JSON value to a Haystack Marker.
fn as_hs_number(&self) -> Option<Number>
fn as_hs_number(&self) -> Option<Number>Convert the JSON value to a Haystack Number.
fn as_hs_remove_marker(&self) -> Option<RemoveMarker>
fn as_hs_remove_marker(&self) -> Option<RemoveMarker>Convert the JSON value to a Haystack Remove Marker.
fn as_hs_symbol(&self) -> Option<Symbol>
fn as_hs_symbol(&self) -> Option<Symbol>Convert the JSON value to a Haystack Symbol.
fn as_hs_time(&self) -> Option<Time>
fn as_hs_time(&self) -> Option<Time>Convert the JSON value to a Haystack Time.
fn as_hs_xstr(&self) -> Option<Xstr>
fn as_hs_xstr(&self) -> Option<Xstr>Return the Haystack XStr value as a Haystack Xstr.
fn is_hs_coord(&self) -> bool
fn is_hs_coord(&self) -> boolReturns true if the JSON value represents a Haystack Coord.
fn is_hs_date(&self) -> bool
fn is_hs_date(&self) -> boolReturns true if the JSON value represents a Haystack Date.
fn is_hs_date_time(&self) -> bool
fn is_hs_date_time(&self) -> boolReturns true if the JSON value represents a Haystack DateTime.
fn is_hs_marker(&self) -> bool
fn is_hs_marker(&self) -> boolReturns true if the JSON value represents a Haystack marker.
fn is_hs_number(&self) -> bool
fn is_hs_number(&self) -> boolReturns true if the JSON value represents a Haystack Number.
fn is_hs_remove_marker(&self) -> bool
fn is_hs_remove_marker(&self) -> boolReturns true if the JSON value represents a Haystack remove marker.
fn is_hs_symbol(&self) -> bool
fn is_hs_symbol(&self) -> boolReturns true if the JSON value represents a Haystack Symbol.
fn is_hs_time(&self) -> bool
fn is_hs_time(&self) -> boolReturns true if the JSON value represents a Haystack Time.
fn is_hs_xstr(&self) -> bool
fn is_hs_xstr(&self) -> boolReturns true if the JSON value represents a Haystack XStr.