Struct cfg_rs::RefValue [−][src]
pub struct RefValue<T>(_, _);Expand description
RefValue means reference of value or refreshable value,
it holds a value which can be updated when Configuration is refreshed.
It implements FromConfig, user can use it in auto deriving config objects.
But it is not supporting recursively usage, following example will cause runtime error:
ⓘ
#[derive(FromConfig)]
struct A {
ref_b: RefValue<B>,
}
#[derive(FromConfig)]
struct B {
ref_c: RefValue<u8>,
}Implementations
Trait Implementations
fn from_config(
context: &mut ConfigContext<'_>,
value: Option<ConfigValue<'_>>
) -> Result<Self, ConfigError>
fn from_config(
context: &mut ConfigContext<'_>,
value: Option<ConfigValue<'_>>
) -> Result<Self, ConfigError>
Generate config from ConfigValue under context.
Auto Trait Implementations
impl<T> RefUnwindSafe for RefValue<T>
impl<T> UnwindSafe for RefValue<T>
Blanket Implementations
Mutably borrows from an owned value. Read more