Skip to content
Snippets Groups Projects
Commit 31a76282 authored by Yaroslav Dynnikov's avatar Yaroslav Dynnikov
Browse files

feature: KVCell data strcture

`KVCell` contains an optional value and provides access by key in two
flavors:

```rust
fn take_or_drop(&mut self, key: &K) -> Option<T>
fn take_or_keep(&mut self, key: &K) -> Option<T>
```

Both return `Some` value only if provided key matches the contained one.

The behavior differs when the provided key doesn't match:
- `take_or_drop` always leaves the cell empty. It supersedes
  `CachedCell` and copies its behavior.
- `take_or_keep` retains contained value. It's a replacement for
  `JointStateLatch`.
parent d2c72c8d
No related branches found
No related tags found
Loading
Checking pipeline status
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment