pub struct Autocomplete { /* private fields */ }Implementations§
Source§impl Autocomplete
impl Autocomplete
pub fn new(items: Vec<AutocompleteItem>, cx: &mut Context<'_, Self>) -> Self
pub fn from_values( values: Vec<impl Into<SharedString>>, cx: &mut Context<'_, Self>, ) -> Self
pub fn placeholder(self, placeholder: impl Into<SharedString>) -> Self
pub fn disabled(self, disabled: bool) -> Self
pub fn clearable(self, clearable: bool) -> Self
pub fn suffix_icon(self, icon: IconName) -> Self
pub fn no_suffix_icon(self) -> Self
pub fn suffix_icon_value(&self) -> Option<IconName>
pub fn width(self, width: impl Into<Pixels>) -> Self
pub fn width_lg(self) -> Self
pub fn max_suggestions(self, max: usize) -> Self
pub fn trigger_on_focus(self, trigger: bool) -> Self
pub fn close_on_escape(self, close: bool) -> Self
pub fn close_on_click_outside(self, close: bool) -> Self
pub fn register_key_bindings(cx: &mut App)
pub fn on_select( self, cb: impl Fn(AutocompleteItem, &mut Window, &mut App) + 'static, ) -> Self
pub fn value(&self, cx: &App) -> SharedString
pub fn set_items( &mut self, items: Vec<AutocompleteItem>, cx: &mut Context<'_, Self>, )
pub fn matching_items_for( items: &[AutocompleteItem], query: &str, max: usize, ) -> Vec<AutocompleteItem>
Trait Implementations§
Source§impl Focusable for Autocomplete
impl Focusable for Autocomplete
Source§fn focus_handle(&self, _cx: &App) -> FocusHandle
fn focus_handle(&self, _cx: &App) -> FocusHandle
Returns the focus handle associated with this view.
Source§impl Render for Autocomplete
impl Render for Autocomplete
Auto Trait Implementations§
impl !RefUnwindSafe for Autocomplete
impl !Send for Autocomplete
impl !Sync for Autocomplete
impl !UnwindSafe for Autocomplete
impl Freeze for Autocomplete
impl Unpin for Autocomplete
impl UnsafeUnpin for Autocomplete
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more