pub trait SearchableItemHandle: ItemHandle {
Show 13 methods
// Required methods
fn downgrade(&self) -> Box<dyn WeakSearchableItemHandle>;
fn boxed_clone(&self) -> Box<dyn SearchableItemHandle>;
fn supported_options(&self) -> SearchOptions;
fn subscribe_to_search_events(
&self,
cx: &mut WindowContext<'_>,
handler: Box<dyn Fn(&SearchEvent, &mut WindowContext<'_>) + Send>
) -> Subscription;
fn clear_matches(&self, cx: &mut WindowContext<'_>);
fn update_matches(
&self,
matches: &Vec<Box<dyn Any + Send>>,
cx: &mut WindowContext<'_>
);
fn query_suggestion(&self, cx: &mut WindowContext<'_>) -> String;
fn activate_match(
&self,
index: usize,
matches: &Vec<Box<dyn Any + Send>>,
cx: &mut WindowContext<'_>
);
fn select_matches(
&self,
matches: &Vec<Box<dyn Any + Send>>,
cx: &mut WindowContext<'_>
);
fn replace(
&self,
_: &Box<dyn Any + Send>,
_: &SearchQuery,
_: &mut WindowContext<'_>
);
fn match_index_for_direction(
&self,
matches: &Vec<Box<dyn Any + Send>>,
current_index: usize,
direction: Direction,
count: usize,
cx: &mut WindowContext<'_>
) -> usize;
fn find_matches(
&self,
query: Arc<SearchQuery>,
cx: &mut WindowContext<'_>
) -> Task<Vec<Box<dyn Any + Send>>>;
fn active_match_index(
&self,
matches: &Vec<Box<dyn Any + Send>>,
cx: &mut WindowContext<'_>
) -> Option<usize>;
}
This method tests for self
and other
values to be equal, and is used
by ==
.
This method tests for !=
. The default implementation is almost always
sufficient, and should not be overridden without very good reason.