openethereum/util/src/from_json.rs

17 lines
294 B
Rust
Raw Normal View History

//! Coversion from json.
2016-01-14 21:24:16 +01:00
use standard::*;
#[macro_export]
macro_rules! xjson {
( $x:expr ) => {
FromJson::from_json($x)
}
}
/// Trait allowing conversion from a JSON value.
2016-01-14 21:24:16 +01:00
pub trait FromJson {
/// Convert a JSON value to an instance of this type.
2016-01-14 21:24:16 +01:00
fn from_json(json: &Json) -> Self;
}