MCPcopy Create free account
hub / github.com/DioxusLabs/dioxus-components / matching_enabled_indices

Method matching_enabled_indices

primitives/src/selectable.rs:112–123  ·  view source on GitHub ↗
(&self, predicate: impl Fn(&OptionState) -> bool)

Source from the content-addressed store, hash-verified

110 }
111
112 fn matching_enabled_indices(&self, predicate: impl Fn(&OptionState) -> bool) -> Vec<usize> {
113 let mut indices: Vec<_> = self
114 .options
115 .read()
116 .iter()
117 .filter(|option| self.collection.is_available(option.index) && predicate(option))
118 .map(|option| option.index)
119 .collect();
120 indices.sort_unstable();
121 indices.dedup();
122 indices
123 }
124
125 pub(crate) fn first_matching_enabled_index(
126 &self,

Callers 2

Calls 2

iterMethod · 0.80
is_availableMethod · 0.80

Tested by

no test coverage detected