Trait edm_core::extension::TomlTableExt
source · pub trait TomlTableExt {
Show 26 methods
// Required methods
fn get_bool(&self, key: &str) -> Option<bool>;
fn get_u8(&self, key: &str) -> Option<u8>;
fn get_u16(&self, key: &str) -> Option<u16>;
fn get_u32(&self, key: &str) -> Option<u32>;
fn get_u64(&self, key: &str) -> Option<u64>;
fn get_usize(&self, key: &str) -> Option<usize>;
fn get_i8(&self, key: &str) -> Option<i8>;
fn get_i16(&self, key: &str) -> Option<i16>;
fn get_i32(&self, key: &str) -> Option<i32>;
fn get_i64(&self, key: &str) -> Option<i64>;
fn get_isize(&self, key: &str) -> Option<isize>;
fn get_f32(&self, key: &str) -> Option<f32>;
fn get_f64(&self, key: &str) -> Option<f64>;
fn get_str(&self, key: &str) -> Option<&str>;
fn get_array(&self, key: &str) -> Option<&Array>;
fn get_str_array(&self, key: &str) -> Option<Vec<&str>>;
fn get_table(&self, key: &str) -> Option<&Table>;
fn get_first_table(&self, key: &str) -> Option<&Table>;
fn get_last_table(&self, key: &str) -> Option<&Table>;
fn get_duration(&self, key: &str) -> Option<Duration>;
fn parse_uuid(&self, key: &str) -> Option<Result<Uuid, Error>>;
fn parse_url(&self, key: &str) -> Option<Result<Url, ParseError>>;
fn parse_ip(&self, key: &str) -> Option<Result<IpAddr, AddrParseError>>;
fn parse_ipv4(&self, key: &str) -> Option<Result<Ipv4Addr, AddrParseError>>;
fn parse_ipv6(&self, key: &str) -> Option<Result<Ipv6Addr, AddrParseError>>;
fn to_map(&self) -> Map;
}Expand description
Extension trait for Table.
Required Methods§
sourcefn get_bool(&self, key: &str) -> Option<bool>
fn get_bool(&self, key: &str) -> Option<bool>
Extracts the boolean value corresponding to the key.
sourcefn get_u8(&self, key: &str) -> Option<u8>
fn get_u8(&self, key: &str) -> Option<u8>
Extracts the integer value corresponding to the key and
represents it as u8 if possible.
sourcefn get_u16(&self, key: &str) -> Option<u16>
fn get_u16(&self, key: &str) -> Option<u16>
Extracts the integer value corresponding to the key and
represents it as u16 if possible.
sourcefn get_u32(&self, key: &str) -> Option<u32>
fn get_u32(&self, key: &str) -> Option<u32>
Extracts the integer value corresponding to the key and
represents it as u32 if possible.
sourcefn get_u64(&self, key: &str) -> Option<u64>
fn get_u64(&self, key: &str) -> Option<u64>
Extracts the integer value corresponding to the key and
represents it as u64 if possible.
sourcefn get_usize(&self, key: &str) -> Option<usize>
fn get_usize(&self, key: &str) -> Option<usize>
Extracts the integer value corresponding to the key and
represents it as usize if possible.
sourcefn get_i8(&self, key: &str) -> Option<i8>
fn get_i8(&self, key: &str) -> Option<i8>
Extracts the integer value corresponding to the key and
represents it as i8 if possible.
sourcefn get_i16(&self, key: &str) -> Option<i16>
fn get_i16(&self, key: &str) -> Option<i16>
Extracts the integer value corresponding to the key and
represents it as i16 if possible.
sourcefn get_i32(&self, key: &str) -> Option<i32>
fn get_i32(&self, key: &str) -> Option<i32>
Extracts the integer value corresponding to the key and
represents it as i32 if possible.
sourcefn get_i64(&self, key: &str) -> Option<i64>
fn get_i64(&self, key: &str) -> Option<i64>
Extracts the integer value corresponding to the key.
sourcefn get_isize(&self, key: &str) -> Option<isize>
fn get_isize(&self, key: &str) -> Option<isize>
Extracts the integer value corresponding to the key and
represents it as isize if possible.
sourcefn get_f32(&self, key: &str) -> Option<f32>
fn get_f32(&self, key: &str) -> Option<f32>
Extracts the float value corresponding to the key and
represents it as f32 if possible.
sourcefn get_str_array(&self, key: &str) -> Option<Vec<&str>>
fn get_str_array(&self, key: &str) -> Option<Vec<&str>>
Extracts the array value corresponding to the key and parses it as Vec<&str>.
sourcefn get_first_table(&self, key: &str) -> Option<&Table>
fn get_first_table(&self, key: &str) -> Option<&Table>
Extracts the first table in an array corresponding to the key.
sourcefn get_last_table(&self, key: &str) -> Option<&Table>
fn get_last_table(&self, key: &str) -> Option<&Table>
Extracts the last table in an array corresponding to the key.
sourcefn get_duration(&self, key: &str) -> Option<Duration>
fn get_duration(&self, key: &str) -> Option<Duration>
Extracts the string corresponding to the key
and parses it as Duration.
sourcefn parse_uuid(&self, key: &str) -> Option<Result<Uuid, Error>>
fn parse_uuid(&self, key: &str) -> Option<Result<Uuid, Error>>
Extracts the string corresponding to the key and parses it as Uuid.
If the Uuid is nil, it also returns None.
sourcefn parse_url(&self, key: &str) -> Option<Result<Url, ParseError>>
fn parse_url(&self, key: &str) -> Option<Result<Url, ParseError>>
Extracts the string corresponding to the key and parses it as Url.
sourcefn parse_ip(&self, key: &str) -> Option<Result<IpAddr, AddrParseError>>
fn parse_ip(&self, key: &str) -> Option<Result<IpAddr, AddrParseError>>
Extracts the string corresponding to the key and parses it as IpAddr.
sourcefn parse_ipv4(&self, key: &str) -> Option<Result<Ipv4Addr, AddrParseError>>
fn parse_ipv4(&self, key: &str) -> Option<Result<Ipv4Addr, AddrParseError>>
Extracts the string corresponding to the key and parses it as Ipv4Addr.
sourcefn parse_ipv6(&self, key: &str) -> Option<Result<Ipv6Addr, AddrParseError>>
fn parse_ipv6(&self, key: &str) -> Option<Result<Ipv6Addr, AddrParseError>>
Extracts the string corresponding to the key and parses it as Ipv6Addr.