Debian Codegraph @

debian/missing-sources/fallible_collections/src/btree.rs

raw
1 //! Implement Fallible Btree, As there is no try_reserve methods on btree, I add no choice but to fork the std implementation and change return types.
2 //! Currently this functionality is only available when building this crate with nightly and the `unstable` feature.
3 pub mod map;
4 pub use map::BTreeMap;
5
6 pub mod set;
7 pub use set::BTreeSet;
8
9 mod node;
10 mod search;
11 use crate::TryReserveError;
12
13 #[doc(hidden)]
14 trait Recover<Q: ?Sized> {
15 type Key;
16
17 fn get(&self, key: &Q) -> Option<&Self::Key>;
18 fn take(&mut self, key: &Q) -> Option<Self::Key>;
19 fn replace(&mut self, key: Self::Key) -> Result<Option<Self::Key>, TryReserveError>;
20 }