pub struct AsyncSearch<'a, T, E> { /* private fields */ }Expand description
A text edit widget that debounces input and automatically triggers an asynchronous search.
AsyncSearch listens to changes in a query string and waits for a specified debounce
threshold before launching the background task. It shows a spinner while the search
is in flight and displays results in a floating dropdown portal.
Implementations§
Source§impl<'a, T, E> AsyncSearch<'a, T, E>
impl<'a, T, E> AsyncSearch<'a, T, E>
Sourcepub fn new(bind: &'a mut Bind<Vec<T>, E>, query: &'a mut String) -> Self
pub fn new(bind: &'a mut Bind<Vec<T>, E>, query: &'a mut String) -> Self
Creates a new AsyncSearch bound to the provided query string and results bind.
Sourcepub const fn debounce_secs(self, secs: f64) -> Self
pub const fn debounce_secs(self, secs: f64) -> Self
Sets the debounce timer threshold (in seconds) before making an async search call.
Sourcepub fn hint_text(self, text: impl Into<String>) -> Self
pub fn hint_text(self, text: impl Into<String>) -> Self
Sets the placeholder text for the search box.
Sourcepub const fn retain_previous_results(self, retain: bool) -> Self
pub const fn retain_previous_results(self, retain: bool) -> Self
If set to true (default), the widget will display the results of the previous
successful search while the user is typing the next query and while the next
query is pending.
Sourcepub const fn wrap_results(self, wrap: bool) -> Self
pub const fn wrap_results(self, wrap: bool) -> Self
Determines if the returned text inside the result rows should wrap or truncate.
Default is false (truncate).
Sourcepub const fn popup_width(self, width: f32) -> Self
pub const fn popup_width(self, width: f32) -> Self
Sets a fixed width for the search results popup. If not provided, it will automatically match the width of the text input.