Skip to content

Draft: Change the GuardMgr API to take an Arc<dyn NetDirProvider>

Nick Mathewson requested to merge nickm/arti:netdir_provider_in_guardmgr into main

@Diziet can you help me out here? I'm trying to fight my way through the type system, and I'm not sure the best way forward.

From a commit message:

This does not compile.  The issue is as follows:

* I cannot convert Arc<D> into Arc<dyn T> if D is ?Sized.  But
  `Arc<D> where D:T+?Sized` is what CircMgr has.

* I cannot convert CircMgr to take Arc<dyn T> itself, since the
  actual type that arti-client gives it is Arc<dyn U>, where U:T,
  and it is not possible to upcast T from U.
  (See http://github.com/rust-lang/lang-team/issues/98)

Merge request reports

Loading