Skip to content

Commit 26e36c9

Browse files
committed
Add a few doc aliases
1 parent 394bf67 commit 26e36c9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/db.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const DEFAULT_TREE_ID: &[u8] = b"__sled__default";
1212
/// to disk, using the same method used by
1313
/// `Tree::flush`.
1414
#[derive(Clone)]
15+
#[doc(alias("database"))]
1516
pub struct Db {
1617
#[doc(hidden)]
1718
pub context: Context,

src/tree.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ fn bounds_error() -> Result<()> {
100100
/// # Ok(()) }
101101
/// ```
102102
#[derive(Clone)]
103+
#[doc(alias("keyspace", "bucket", "table"))]
103104
pub struct Tree(pub(crate) Arc<TreeInner>);
104105

105106
#[allow(clippy::module_name_repetitions)]
@@ -150,6 +151,7 @@ impl Tree {
150151
/// assert_eq!(db.insert(&[1, 2, 3], vec![1]), Ok(Some(sled::IVec::from(&[0]))));
151152
/// # Ok(()) }
152153
/// ```
154+
#[doc(alias("set"))]
153155
pub fn insert<K, V>(&self, key: K, value: V) -> Result<Option<IVec>>
154156
where
155157
K: AsRef<[u8]>,
@@ -542,6 +544,7 @@ impl Tree {
542544
/// assert_eq!(db.remove(&[1]), Ok(None));
543545
/// # Ok(()) }
544546
/// ```
547+
#[doc(alias("delete", "del"))]
545548
pub fn remove<K: AsRef<[u8]>>(&self, key: K) -> Result<Option<IVec>> {
546549
let mut guard = pin();
547550
let _cc = concurrency_control::read();
@@ -607,6 +610,7 @@ impl Tree {
607610
/// # Ok(()) }
608611
/// ```
609612
#[allow(clippy::needless_pass_by_value)]
613+
#[doc(alias("cas", "tas", "test_and_set", "test_and_swap", "compare_and_set"))]
610614
pub fn compare_and_swap<K, OV, NV>(
611615
&self,
612616
key: K,

0 commit comments

Comments
 (0)