Closed pando85 closed 1 week ago
I tried to return an Slice or an iterator but it requires a collect anyway because store is behind a RwLock
.
Attention: Patch coverage is 0%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 75.3%. Comparing base (
9c402a6
) to head (9f04a48
). Report is 1 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
kube-runtime/src/reflector/store.rs | 0.0% | 3 Missing :warning: |
it requires a collect anyway because store is behind a RwLock.
can't you move the RwLockReadGuard into the returned iterator?
I don't understand your point @SOF3 . Could you elaborate on it a bit?
I am just confused why we need so many special methods on Store
instead of exposing a map-like API that provides iter()
. Is it simply because we don't want to implement a custom Iterator
type that owns its own RwLockReadGuard
?
@SOF3 that's a good point. In deed, we already have the state
method which returns an iterator through all the objects.
I can close this and use that method.
Thank you both.
Resolves #1633.
Motivation
Solution