From: Ian Jackson Date: Sat, 18 Jul 2020 21:33:30 +0000 (+0100) Subject: docs X-Git-Tag: otter-0.2.0~1295 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=deb89dc2f551e8d86dfd06a5866ec54611ee3cdd;p=otter.git docs --- diff --git a/src/slotmap-slot-idx.rs b/src/slotmap-slot-idx.rs index 9f39adc3..4825864c 100644 --- a/src/slotmap-slot-idx.rs +++ b/src/slotmap-slot-idx.rs @@ -1,16 +1,17 @@ -//! Provides a `get_idx_key` method on `slotmap::KeyData`. -//! See `KeyDataExt`. +//! Provides a [`get_idx_key`](trait.KeyDataExt.html#tymethod.get_idx_version) method on +//! `slotmap::KeyData`. See [KeyDataExt::get_idx_version]. /// Extension trait for `slotmap::KeyData`, providing `get_idx_version`. /// /// No-one is expected to implement this trait for anything else. pub trait KeyDataExt { /// Returns the slot index and version. This is useful only in - /// unusual situations. At any one time, a slotmap has at most - /// one entry with each index. The combination of index and - /// version are unique across time. Indices are generally not - /// significantly bigger than thw maximum ever occupancy. No - /// other guarantees are made. + /// unusual situations. + /// + /// At any one time, a slotmap has at most one entry with each + /// index. The combination of index and version are unique across + /// time. Indices are generally not significantly bigger than thw + /// maximum ever occupancy. No other guarantees are made. /// /// For serialisation, use `serde` or `as_ffi`. /// @@ -20,6 +21,9 @@ pub trait KeyDataExt { /// representation has changed too much. This ought to be caught /// by the tests, and would probably be a breaking change in the /// underlying `slotmap` crate in any case. + /// + /// If you prefer to receive an error rather than panicing, + /// see [keydata_extract]. fn get_idx_version(self) -> (u32, u32); }