pub struct ClosureResolver<F1, F2>where
F1: Fn(&str, &str) -> PathBuf + Send + Sync + 'static,
F2: Fn(&str, &str) -> PathBuf + Send + Sync + 'static,{ /* private fields */ }Expand description
Builder helper: a closure-backed resolver. Useful at the boot wire when the lookup needs to consult an existing struct (e.g. an agent registry) without forcing the caller to define a dedicated type.
Implementations§
Trait Implementations§
Source§impl<F1, F2> PathResolver for ClosureResolver<F1, F2>
impl<F1, F2> PathResolver for ClosureResolver<F1, F2>
Auto Trait Implementations§
impl<F1, F2> Freeze for ClosureResolver<F1, F2>
impl<F1, F2> RefUnwindSafe for ClosureResolver<F1, F2>where
F1: RefUnwindSafe,
F2: RefUnwindSafe,
impl<F1, F2> Send for ClosureResolver<F1, F2>
impl<F1, F2> Sync for ClosureResolver<F1, F2>
impl<F1, F2> Unpin for ClosureResolver<F1, F2>
impl<F1, F2> UnsafeUnpin for ClosureResolver<F1, F2>where
F1: UnsafeUnpin,
F2: UnsafeUnpin,
impl<F1, F2> UnwindSafe for ClosureResolver<F1, F2>where
F1: UnwindSafe,
F2: 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more