[−][src]Struct pushrod::widget::config::Configurable
Default Configurable object, created for each struct represented in the
impl_configurable! macro.
Methods
impl Configurable[src]
Implementation of the default Configurable object.
There are two ways in which configuration objects can be used:
fn main() { let mut config: Configurable = Configurable::new(); config.set(Origin(Point { x: 0, y: 100 })); config.set(BodySize(Size { w: 150, h: 150 })); // To get the value of the Origin, you can use type inference: let main_origin: &Origin = config.get().unwrap(); // Or you can use declared types with ::<> as such: let body_size = &config.get::<BodySize>().unwrap().0; }
pub fn new() -> Self[src]
pub fn set<T: ConfigKey>(&mut self, value: T)[src]
pub fn get<T: ConfigKey>(&self) -> Option<&T>[src]
pub fn remove<T: ConfigKey>(&mut self)[src]
pub fn contains_key<T: ConfigKey>(&self) -> bool[src]
Trait Implementations
impl Default for Configurable[src]
fn default() -> Configurable[src]
Auto Trait Implementations
impl Send for Configurable
impl Sync for Configurable
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> From for T[src]
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
Sets value as a parameter of self.