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§

source

fn as_u8(&self) -> Option<u8>

If the Value is an integer, represent it as u8 if possible. Returns None otherwise.

source

fn as_u16(&self) -> Option<u16>

If the Value is an integer, represent it as u16 if possible. Returns None otherwise.

source

fn as_u32(&self) -> Option<u32>

If the Value is an integer, represent it as u32 if possible. Returns None otherwise.

source

fn as_usize(&self) -> Option<usize>

If the Value is an integer, represent it as usize if possible. Returns None otherwise.

source

fn as_i8(&self) -> Option<i8>

If the Value is an integer, represent it as i8 if possible. Returns None otherwise.

source

fn as_i16(&self) -> Option<i16>

If the Value is an integer, represent it as i16 if possible. Returns None otherwise.

source

fn as_i32(&self) -> Option<i32>

If the Value is an integer, represent it as i32 if possible. Returns None otherwise.

source

fn as_isize(&self) -> Option<isize>

If the Value is an integer, represent it as isize if possible. Returns None otherwise.

source

fn as_f32(&self) -> Option<f32>

If the Value is a float, represent it as f32 if possible. Returns None otherwise.

source

fn to_json_value(&self) -> JsonValue

Converts self to a JSON value.

Implementors§