pub struct Environment<T> { /* private fields */ }
Implementations§
Source§impl<T> Environment<T>
impl<T> Environment<T>
pub fn new() -> Self
pub fn add_str_with_cb( &mut self, key: &str, val: &str, help: &str, data: &mut T, cb: StrFn<T>, ) -> Result<(), EnvErr>
pub fn add_str( &mut self, key: &str, val: &str, help: &str, ) -> Result<(), EnvErr>
pub fn get_str(&self, key: &str) -> Result<&str, EnvErr>
pub fn set_str( &mut self, key: &str, value: &str, data: &mut T, ) -> Result<(), EnvErr>
pub fn is_str(&self, key: &str) -> bool
pub fn add_u64_with_cb( &mut self, key: &str, val: u64, help: &str, data: &mut T, cb: U64Fn<T>, ) -> Result<(), EnvErr>
pub fn add_u64(&mut self, key: &str, val: u64, help: &str) -> Result<(), EnvErr>
pub fn get_u64(&self, key: &str) -> Result<u64, EnvErr>
pub fn set_u64( &mut self, key: &str, value: u64, data: &mut T, ) -> Result<(), EnvErr>
pub fn is_u64(&self, key: &str) -> bool
pub fn add_i64_with_cb( &mut self, key: &str, val: i64, help: &str, data: &mut T, cb: I64Fn<T>, ) -> Result<(), EnvErr>
pub fn add_i64(&mut self, key: &str, val: i64, help: &str) -> Result<(), EnvErr>
pub fn get_i64(&self, key: &str) -> Result<i64, EnvErr>
pub fn set_i64( &mut self, key: &str, value: i64, data: &mut T, ) -> Result<(), EnvErr>
pub fn is_i64(&self, key: &str) -> bool
pub fn add_bool_with_cb( &mut self, key: &str, val: bool, help: &str, data: &mut T, cb: BoolFn<T>, ) -> Result<(), EnvErr>
pub fn add_bool( &mut self, key: &str, val: bool, help: &str, ) -> Result<(), EnvErr>
pub fn get_bool(&self, key: &str) -> Result<bool, EnvErr>
pub fn set_bool( &mut self, key: &str, value: bool, data: &mut T, ) -> Result<(), EnvErr>
pub fn is_bool(&self, key: &str) -> bool
pub fn add_color_with_cb( &mut self, key: &str, val: (u8, u8, u8), help: &str, data: &mut T, cb: ColorFn<T>, ) -> Result<(), EnvErr>
pub fn add_color( &mut self, key: &str, val: (u8, u8, u8), help: &str, ) -> Result<(), EnvErr>
pub fn get_color(&self, key: &str) -> Result<(u8, u8, u8), EnvErr>
pub fn set_color( &mut self, key: &str, value: (u8, u8, u8), data: &mut T, ) -> Result<(), EnvErr>
pub fn is_color(&self, key: &str) -> bool
pub fn reset(&mut self, key: &str, data: &mut T) -> Result<(), EnvErr>
pub fn get(&self, key: &str) -> Option<EnvData<'_>>
pub fn get_help(&self, key: &str) -> Option<&str>
pub fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = (&str, EnvData<'_>)> + 'a>
Trait Implementations§
Source§impl<T: Default> Default for Environment<T>
impl<T: Default> Default for Environment<T>
Source§fn default() -> Environment<T>
fn default() -> Environment<T>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<T> Freeze for Environment<T>
impl<T> RefUnwindSafe for Environment<T>
impl<T> Send for Environment<T>
impl<T> Sync for Environment<T>
impl<T> Unpin for Environment<T>
impl<T> UnwindSafe for Environment<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more