takecell

lib.rs docs

takecell provides two new cell-like types, TakeCell and TakeOwnCell. Both may store arbitrary non-Copy types, can be read from at most once and provide direct unique access to the stored contents. The core API looks roughly like this:

```rust,ignore impl TakeCell { const fn new(v: T) -> Self { ... } } impl TakeCell { fn take(&self) -> Option<&mut T> { ... } }

impl TakeOwnCell { const fn new(v: T) -> Self { ... } fn take(&self) -> Option { ... } } ```