Trait humphrey_server::config::extended_hashmap::ExtendedMap [−][src]
pub trait ExtendedMap<K, V> {
fn get_owned(&self, key: K) -> Option<V>;
fn get_optional(&self, key: K, default: V) -> V;
fn get_compulsory(
&self,
key: K,
error: &'static str
) -> Result<V, &'static str>;
fn get_optional_parsed<T>(
&self,
key: K,
default: T,
error: &'static str
) -> Result<T, &'static str>
where
T: FromStr;
fn get_compulsory_parsed<T>(
&self,
key: K,
error: &'static str
) -> Result<T, &'static str>
where
T: FromStr;
}
Required methods
fn get_optional(&self, key: K, default: V) -> V
fn get_optional(&self, key: K, default: V) -> V
Gets an item from the map or returns a given default.
fn get_compulsory(&self, key: K, error: &'static str) -> Result<V, &'static str>
fn get_compulsory(&self, key: K, error: &'static str) -> Result<V, &'static str>
Gets an item from the map or returns the given error.
Gets an item from the map or a given default and parses it, or returns the given error.