Trait edm_core::extension::TomlValueExt
source · pub trait TomlValueExt {
// Required methods
fn as_u8(&self) -> Option<u8>;
fn as_u16(&self) -> Option<u16>;
fn as_u32(&self) -> Option<u32>;
fn as_usize(&self) -> Option<usize>;
fn as_i8(&self) -> Option<i8>;
fn as_i16(&self) -> Option<i16>;
fn as_i32(&self) -> Option<i32>;
fn as_isize(&self) -> Option<isize>;
fn as_f32(&self) -> Option<f32>;
fn to_json_value(&self) -> JsonValue;
}Expand description
Extension trait for toml::Value.
Required Methods§
sourcefn as_u8(&self) -> Option<u8>
fn as_u8(&self) -> Option<u8>
If the Value is an integer, represent it as u8 if possible.
Returns None otherwise.
sourcefn as_u16(&self) -> Option<u16>
fn as_u16(&self) -> Option<u16>
If the Value is an integer, represent it as u16 if possible.
Returns None otherwise.
sourcefn as_u32(&self) -> Option<u32>
fn as_u32(&self) -> Option<u32>
If the Value is an integer, represent it as u32 if possible.
Returns None otherwise.
sourcefn as_usize(&self) -> Option<usize>
fn as_usize(&self) -> Option<usize>
If the Value is an integer, represent it as usize if possible.
Returns None otherwise.
sourcefn as_i8(&self) -> Option<i8>
fn as_i8(&self) -> Option<i8>
If the Value is an integer, represent it as i8 if possible.
Returns None otherwise.
sourcefn as_i16(&self) -> Option<i16>
fn as_i16(&self) -> Option<i16>
If the Value is an integer, represent it as i16 if possible.
Returns None otherwise.
sourcefn as_i32(&self) -> Option<i32>
fn as_i32(&self) -> Option<i32>
If the Value is an integer, represent it as i32 if possible.
Returns None otherwise.
sourcefn as_isize(&self) -> Option<isize>
fn as_isize(&self) -> Option<isize>
If the Value is an integer, represent it as isize if possible.
Returns None otherwise.
sourcefn as_f32(&self) -> Option<f32>
fn as_f32(&self) -> Option<f32>
If the Value is a float, represent it as f32 if possible.
Returns None otherwise.
sourcefn to_json_value(&self) -> JsonValue
fn to_json_value(&self) -> JsonValue
Converts self to a JSON value.