pub struct SourceRegistry { /* private fields */ }Expand description
A registry that maps source IDs to their Source implementations.
EnvSource is registered under "env" by default. Additional sources
can be added with register; registering an
already-used ID replaces the previous source.
Pass a registry to Secret::bind or
bind_all to resolve secrets.
Implementations§
Source§impl SourceRegistry
impl SourceRegistry
Sourcepub fn register(
&mut self,
id: impl Into<String>,
source: impl Source + 'static,
) -> Result<(), SourceRegisterError>
pub fn register( &mut self, id: impl Into<String>, source: impl Source + 'static, ) -> Result<(), SourceRegisterError>
Registers a source under the given id.
The id must match the source_id component of the secret URN and
must consist only of characters valid in a URN NSS: ASCII letters,
digits, and -._~!$&'()*+,;=@/. Returns
SourceRegisterError::InvalidSourceId if the id is empty or contains
invalid characters.
If id is already registered, the previous source is replaced.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SourceRegistry
impl !RefUnwindSafe for SourceRegistry
impl Send for SourceRegistry
impl Sync for SourceRegistry
impl Unpin for SourceRegistry
impl UnsafeUnpin for SourceRegistry
impl !UnwindSafe for SourceRegistry
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