Skip to content

Commit

Permalink
stable_set: add doc comment explaining StableMap generic arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
aiju committed Oct 17, 2024
1 parent 8e147b2 commit 1bce70d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions stable_set/src/stable_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ use index_table::{IndexTable, SmallIndex};
use std::{borrow::Borrow, hash::BuildHasher, ops::RangeBounds};

/// A hash map that maintains the order of its elements.
///
/// In `StableMap<K, V, S, W>`,
/// `K: Hash + Eq` is the type of keys,
/// `V` is the type of values,
/// `S: BuildHasher` is used for hashing elements
/// and `W: SmallIndex` is the type used for small indices internally (`W` should usually be omitted, it then defaults to `u32`).
#[derive(Clone)]
pub struct StableMap<K, V, S, W=u32> {
index_table: IndexTable<W>,
Expand Down

0 comments on commit 1bce70d

Please sign in to comment.