pub struct MemorySource { /* private fields */ }Expand description
A configuration source that holds data in memory.
Useful for testing or providing default values.
Implementations§
Source§impl MemorySource
impl MemorySource
Sourcepub fn new(data: ConfigValue) -> Self
pub fn new(data: ConfigValue) -> Self
Create a new memory source with the given data.
Sourcepub fn with_name(data: ConfigValue, name: impl Into<String>) -> Self
pub fn with_name(data: ConfigValue, name: impl Into<String>) -> Self
Create a new memory source with a custom name.
Trait Implementations§
Source§impl Source for MemorySource
impl Source for MemorySource
Source§fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ConfigValue>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ConfigValue>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
👎Deprecated since 0.4.0: Use the Loader trait instead. Source will be removed in a future version.
Load configuration data from this source.
Auto Trait Implementations§
impl Freeze for MemorySource
impl RefUnwindSafe for MemorySource
impl Send for MemorySource
impl Sync for MemorySource
impl Unpin for MemorySource
impl UnwindSafe for MemorySource
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