pub struct ResolverLookup<'a>(pub &'a dyn Resolver);Expand description
Adapts a &dyn Resolver to Lookup, since both traits share the exact
lookup(&self, name: &str) -> Option<String> signature. Needed at the
config↔variables module boundary: variables::expand::expand_map and
expand_definition take &dyn Lookup, but config::caproni’s loader
only has a Box<dyn Resolver> to offer them. A thin wrapper struct is
used rather than impl Lookup for dyn Resolver, because Rust’s dyn-to-
dyn coercion only applies to supertrait upcasting, not an arbitrary
blanket impl relating two unrelated traits.
Tuple Fields§
§0: &'a dyn ResolverTrait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ResolverLookup<'a>
impl<'a> !Send for ResolverLookup<'a>
impl<'a> !Sync for ResolverLookup<'a>
impl<'a> !UnwindSafe for ResolverLookup<'a>
impl<'a> Freeze for ResolverLookup<'a>
impl<'a> Unpin for ResolverLookup<'a>
impl<'a> UnsafeUnpin for ResolverLookup<'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