pub struct PathResolver<'a> { /* private fields */ }Expand description
Read-only view over a RouterConfig that answers
“which source serves this path?” without invoking any source
plugin.
Cheap to construct (just borrows the config), so call sites can re-create one per query if the config might have been reloaded in the meantime. The resolver itself caches nothing; the adaptive cache lands in P5.4.
Implementations§
Source§impl<'a> PathResolver<'a>
impl<'a> PathResolver<'a>
Sourcepub fn new(config: &'a RouterConfig) -> Self
pub fn new(config: &'a RouterConfig) -> Self
Build a resolver borrowing from config.
Sourcepub fn resolve(
&self,
path: &SecretPath,
) -> Result<RouteDecision<'a>, ResolveError>
pub fn resolve( &self, path: &SecretPath, ) -> Result<RouteDecision<'a>, ResolveError>
Run the algorithm from the module docs against path.
Auto Trait Implementations§
impl<'a> Freeze for PathResolver<'a>
impl<'a> RefUnwindSafe for PathResolver<'a>
impl<'a> Send for PathResolver<'a>
impl<'a> Sync for PathResolver<'a>
impl<'a> Unpin for PathResolver<'a>
impl<'a> UnsafeUnpin for PathResolver<'a>
impl<'a> UnwindSafe for PathResolver<'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