pub struct ConfigVars { /* private fields */ }
Expand description
Map of configs already bound to a variable.
The map only holds a weak reference to the variables.
Implementations§
source§impl ConfigVars
impl ConfigVars
sourcepub fn get_or_bind<T: ConfigValue>(
&mut self,
key: ConfigKey,
bind: impl FnOnce(&ConfigKey) -> BoxedVar<T>,
) -> BoxedVar<T>
pub fn get_or_bind<T: ConfigValue>( &mut self, key: ConfigKey, bind: impl FnOnce(&ConfigKey) -> BoxedVar<T>, ) -> BoxedVar<T>
Gets the already bound variable or calls bind
to generate a new binding.
sourcepub fn get_or_bind_contains(
&mut self,
key: ConfigKey,
bind: impl FnOnce(&ConfigKey) -> BoxedVar<bool>,
) -> BoxedVar<bool>
pub fn get_or_bind_contains( &mut self, key: ConfigKey, bind: impl FnOnce(&ConfigKey) -> BoxedVar<bool>, ) -> BoxedVar<bool>
Bind the contains variable.
sourcepub fn rebind(&mut self, source: &mut dyn AnyConfig)
pub fn rebind(&mut self, source: &mut dyn AnyConfig)
Bind all variables to the new source
.
If the map entry is present in the source
the variable is updated to the new value, if not the entry
is inserted in the source. The variable is then bound to the source.
sourcepub fn low_memory(&mut self)
pub fn low_memory(&mut self)
System warning low memory, flush caches.
Trait Implementations§
source§impl Default for ConfigVars
impl Default for ConfigVars
source§fn default() -> ConfigVars
fn default() -> ConfigVars
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConfigVars
impl !RefUnwindSafe for ConfigVars
impl Send for ConfigVars
impl Sync for ConfigVars
impl Unpin for ConfigVars
impl !UnwindSafe for ConfigVars
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more