We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54c5cd6 commit af5fd08Copy full SHA for af5fd08
src/selector.rs
@@ -405,6 +405,14 @@ impl Selector {
405
}
406
407
408
+ /// Returns the number of subselectors under this selector (by definition 0 for simple selectors)
409
+ pub fn len(&self) -> usize {
410
+ match self {
411
+ Selector::MultiSelector(v) | Selector::CompositeSelector(v) | Selector::DirectionalSelector(v) => v.len(),
412
+ _ => 0,
413
+ }
414
415
+
416
/// Returns the textselection this selector points at, if any
417
pub fn textselection<'store>(&self, store: &'store AnnotationStore) -> Option<&'store TextSelection> {
418
match self {
0 commit comments