Skip to content

Commit 3b9c9ec

Browse files
committed
Add docs for Indexable trait
1 parent 8d93e6f commit 3b9c9ec

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/index.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,19 @@ pub struct Indexer<'object> {
8080
marker: PhantomData<&'object ()>,
8181
}
8282

83-
// Trait that indicates that object can be used for indexing
84-
//
85-
// Any object to be able to be passed on to [./struct.Indexer.html#method.set_index] method
86-
// should implement this trait with appropriate implementation
83+
/// Trait bound indicating indexability
84+
///
85+
/// Any object to be able to be passed on to [Indexer::set_index()](./struct.Indexer.html#method.set_index) method should implement this trait with appropriate implementation of `set` method.
8786
pub trait Indexable {
87+
/// Set indexing object for a given dimension
88+
///
89+
/// # Parameters
90+
///
91+
/// - `idxr` is mutable reference to [Indexer](./struct.Indexer.html) object which will
92+
/// be modified to set `self` indexable along `dim` dimension.
93+
/// - `dim` is the dimension along which `self` indexable will be used for indexing.
94+
/// - `is_batch` is only used if `self` is [Seq](./struct.Seq.html) to indicate if indexing
95+
/// along `dim` is a batched operation.
8896
fn set(&self, idxr: &mut Indexer, dim: u32, is_batch: Option<bool>);
8997
}
9098

0 commit comments

Comments
 (0)