pub struct TypedConfigKey<T> { /* private fields */ }Expand description
Type-safe configuration key.
Binds a configuration path to a specific type for compile-time safety.
Implementations§
Source§impl<T> TypedConfigKey<T>
impl<T> TypedConfigKey<T>
Sourcepub const fn with_description(self, description: &'static str) -> Self
pub const fn with_description(self, description: &'static str) -> Self
Add a description to the key.
Sourcepub fn description(&self) -> Option<&'static str>
pub fn description(&self) -> Option<&'static str>
Get the description.
Source§impl<T: Clone + Send + Sync + 'static> TypedConfigKey<T>
impl<T: Clone + Send + Sync + 'static> TypedConfigKey<T>
Sourcepub fn get<'a>(
&self,
provider: &'a impl ConfigProvider,
) -> Option<&'a AnnotatedValue>
pub fn get<'a>( &self, provider: &'a impl ConfigProvider, ) -> Option<&'a AnnotatedValue>
Get the value from a provider.
Trait Implementations§
Source§impl<T: Clone> Clone for TypedConfigKey<T>
impl<T: Clone> Clone for TypedConfigKey<T>
Source§fn clone(&self) -> TypedConfigKey<T>
fn clone(&self) -> TypedConfigKey<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for TypedConfigKey<T>
impl<T> RefUnwindSafe for TypedConfigKey<T>where
T: RefUnwindSafe,
impl<T> Send for TypedConfigKey<T>where
T: Send,
impl<T> Sync for TypedConfigKey<T>where
T: Sync,
impl<T> Unpin for TypedConfigKey<T>where
T: Unpin,
impl<T> UnsafeUnpin for TypedConfigKey<T>
impl<T> UnwindSafe for TypedConfigKey<T>where
T: UnwindSafe,
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