Skip to content

Commit 08cb01e

Browse files
committed
Mark IndexedMap types as (C-not exported)
While we could try to expose the type explicitly, we already have alternative accessors for bindings, and mapping `Hash`, `Ord` and the other requirements for `IndexedMap` would be a good chunk of additional work.
1 parent 8311581 commit 08cb01e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lightning/src/util/indexed_map.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ use core::ops::{Bound, RangeBounds};
2121
/// actually backed by a [`HashMap`], with some additional tracking to ensure we can iterate over
2222
/// keys in the order defined by [`Ord`].
2323
///
24+
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
25+
///
2426
/// [`BTreeMap`]: alloc::collections::BTreeMap
2527
#[derive(Clone, Debug, Eq)]
2628
pub struct IndexedMap<K: Hash + Ord, V> {
@@ -147,6 +149,8 @@ impl<K: Hash + Ord + PartialEq, V: PartialEq> PartialEq for IndexedMap<K, V> {
147149
}
148150

149151
/// An iterator over a range of values in an [`IndexedMap`]
152+
///
153+
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
150154
pub struct Range<'a, K: Hash + Ord, V> {
151155
inner_range: Iter<'a, K>,
152156
map: &'a HashMap<K, V>,
@@ -161,6 +165,8 @@ impl<'a, K: Hash + Ord, V: 'a> Iterator for Range<'a, K, V> {
161165
}
162166

163167
/// An [`Entry`] for a key which currently has no value
168+
///
169+
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
164170
pub struct VacantEntry<'a, K: Hash + Ord, V> {
165171
#[cfg(feature = "hashbrown")]
166172
underlying_entry: hash_map::VacantEntry<'a, K, V, hash_map::DefaultHashBuilder>,
@@ -171,6 +177,8 @@ pub struct VacantEntry<'a, K: Hash + Ord, V> {
171177
}
172178

173179
/// An [`Entry`] for an existing key-value pair
180+
///
181+
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
174182
pub struct OccupiedEntry<'a, K: Hash + Ord, V> {
175183
#[cfg(feature = "hashbrown")]
176184
underlying_entry: hash_map::OccupiedEntry<'a, K, V, hash_map::DefaultHashBuilder>,
@@ -181,6 +189,8 @@ pub struct OccupiedEntry<'a, K: Hash + Ord, V> {
181189

182190
/// A mutable reference to a position in the map. This can be used to reference, add, or update the
183191
/// value at a fixed key.
192+
///
193+
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
184194
pub enum Entry<'a, K: Hash + Ord, V> {
185195
/// A mutable reference to a position within the map where there is no value.
186196
Vacant(VacantEntry<'a, K, V>),

0 commit comments

Comments
 (0)