arc-swap
arc-swap copied to clipboard
Make types like `Box<dyn DynAccess>` implement Access
by generalizing the P: Deref-implementation to ?Sized,
and implementing Access for some dyn DynAccess
trait object types.
Not yet documented or polished, this PRs main purpose for now is to allow CI testing.
The failing clippy lints are unrelated to this PR.
Older compiler version apparently fails in one of the dependencies (half
).
Codecov Report
Merging #78 (a113002) into master (f7f192d) will increase coverage by
0.60%
. The diff coverage is33.33%
.
@@ Coverage Diff @@
## master #78 +/- ##
==========================================
+ Coverage 83.37% 83.97% +0.60%
==========================================
Files 18 18
Lines 1149 1161 +12
==========================================
+ Hits 958 975 +17
+ Misses 191 186 -5
Impacted Files | Coverage Δ | |
---|---|---|
src/access.rs | 86.02% <33.33%> (-7.81%) |
:arrow_down: |
src/lib.rs | 87.56% <0.00%> (+0.51%) |
:arrow_up: |
src/strategy/hybrid.rs | 93.84% <0.00%> (+6.15%) |
:arrow_up: |
src/debt/helping.rs | 89.06% <0.00%> (+10.93%) |
:arrow_up: |
@vorner I’ve addressed the unrelated CI failures (I don’t know if that’s the "proper" way to do this with the dependencies for 1.45 compilation, but it seems like it works); feel free to re-run CI.
are there any cases left where it is necessary?
as already noted over in #77:
the actual
AccessConvert
is somewhat more general, as it allows – say –Box<dyn Foo>
for a traitFoo: DynAccess
, too.
Similarly, you can use it for things like Box<dyn DynAccess + Unpin>
or Box<dyn DynAccess + Sync>
or other more rare variantions on the trait object type that I didn't cover with any explicit implementation. (I chose the same selection three of auto-trait combinations (none, only send, and send+sync) that e. g. dyn Any
in the standard library supports for downcasting; if there are others with practical use, they can be added later.)
Hello again. Just wanted to check, are you still working on the docs, or did that one get lost in the rest of the discussion? 😇 Just that we both don't wait on something from the other side.
Thanks for the ping. I didn’t misunderstand, but I haven’t written the docs yet either; I’ll try to allocate some time to this soon :-)
Hello.
I've discovered this still sits here. Not that I would have too much free time myself, but should I just take it over and write the docs, so it moves forward?
I forgot this PR even exists, so ehm... sure, feel free to take over, thank you.
I've taken the main commit, put it onto current (which already had the CI issues mostly solved) master and made some docs for it and merged in #85.
I'll try to collect few more outstanding PRs and release a new version soon. If I don't get around to it by the end of the year, feel free to ping me.
Thank you for discovering the way to do this :-)