pub struct Resolver<'a> { /* private fields */ }Expand description
Resolves references, fetching each distinct path once.
Implementations§
Source§impl<'a> Resolver<'a>
impl<'a> Resolver<'a>
pub fn new(source: &'a dyn SecretSource) -> Resolver<'a>
Sourcepub async fn value(&mut self, key: &str, value: &str) -> Result<Option<String>>
pub async fn value(&mut self, key: &str, value: &str) -> Result<Option<String>>
Resolve one value, or None if it was not a reference.
Sourcepub async fn pairs(
&mut self,
pairs: &mut BTreeMap<String, String>,
) -> Result<usize>
pub async fn pairs( &mut self, pairs: &mut BTreeMap<String, String>, ) -> Result<usize>
Resolve every reference in a flat map, in place, and say how many.
This is the shape a parsed .env comes in, and the shape anything else
keyed by name can be put into.
Sourcepub async fn config(&mut self, config: &Config, roots: &[&str]) -> Result<usize>
pub async fn config(&mut self, config: &Config, roots: &[&str]) -> Result<usize>
Resolve every reference under each of these configuration paths.
The roots have to be named because Config offers no way to
enumerate its top level, and a resolver that guessed at namespaces
would be the runtime magic this framework does without. Each root is a
dotted path and its whole subtree is searched, so "database" covers
database.connections.pgsql.password.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Resolver<'a>
impl<'a> !UnwindSafe for Resolver<'a>
impl<'a> Freeze for Resolver<'a>
impl<'a> Send for Resolver<'a>
impl<'a> Sync for Resolver<'a>
impl<'a> Unpin for Resolver<'a>
impl<'a> UnsafeUnpin for Resolver<'a>
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