Skip to main content

TryGetableFromJson

Trait TryGetableFromJson 

Source
pub trait TryGetableFromJson: Sized
where for<'de> Self: Deserialize<'de>,
{ // Provided methods fn try_get_from_json<I: ColIdx>( res: &QueryResult, idx: I, ) -> Result<Self, TryGetError> { ... } fn from_json_vec(value: Value) -> Result<Vec<Self>, TryGetError> { ... } }
Available on crate feature with-json only.
Expand description

An interface to get a JSON from the query result

Provided Methods§

Source

fn try_get_from_json<I: ColIdx>( res: &QueryResult, idx: I, ) -> Result<Self, TryGetError>

Get a JSON from the query result with prefixed column name

Source

fn from_json_vec(value: Value) -> Result<Vec<Self>, TryGetError>

Decode a JSON array into a Vec<Self>.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<K, V> TryGetableFromJson for BTreeMap<K, V>

Source§

impl<K, V> TryGetableFromJson for HashMap<K, V>

Implementors§