pub trait ValueReader {
// Provided methods
fn get_str<'tr>(&'tr self, rhs: &'tr str) -> &'tr str { ... }
fn get_string(&self, rhs: String) -> String { ... }
fn get_i64(&self, rhs: i64) -> i64 { ... }
fn get_f64(&self, rhs: f64) -> f64 { ... }
fn get_bool(&self, rhs: bool) -> bool { ... }
}Expand description
Extend method to read Value, and support operator | rhs_default.
The default implementation just return rhs without any treatment.
It is dependent for concrete Value type how extract value from node.
Provided Methods§
Sourcefn get_str<'tr>(&'tr self, rhs: &'tr str) -> &'tr str
fn get_str<'tr>(&'tr self, rhs: &'tr str) -> &'tr str
Support operator | "" or some default &str.
Usually return slice refers to string held in node if possible.
Sourcefn get_string(&self, rhs: String) -> String
fn get_string(&self, rhs: String) -> String
Support operator | String.
For json pointer it would return stringfy of node except already string.
Sourcefn get_i64(&self, rhs: i64) -> i64
fn get_i64(&self, rhs: i64) -> i64
Support operator | 0 or some default i64.
For json pointer, it will also try to parse from string node.
Implementations on Foreign Types§
Source§impl ValueReader for Value
impl ValueReader for Value
Source§fn get_string(&self, rhs: String) -> String
fn get_string(&self, rhs: String) -> String
operator | String.