pub struct AutocompleteItem { /* private fields */ }Expand description
Autocomplete suggestion with optional icon and reactive availability.
The label is both visible text and the exact value committed on activation. Duplicate and empty labels are allowed.
§Examples
use ailloli_ui_widgets::controls::AutocompleteItem;
let item = AutocompleteItem::new("Apricot").disabled(false);
let _ = item;Implementations§
Source§impl AutocompleteItem
impl AutocompleteItem
Sourcepub fn new(label: impl Into<String>) -> Self
pub fn new(label: impl Into<String>) -> Self
Creates an enabled, iconless item and stores its label unchanged.
§Examples
use ailloli_ui_widgets::controls::AutocompleteItem;
let item = AutocompleteItem::new("Apple");
let _ = item;Sourcepub fn disabled(self, disabled: impl Into<Binding<bool>>) -> Self
pub fn disabled(self, disabled: impl Into<Binding<bool>>) -> Self
Replaces the item’s static or reactive disabled binding.
§Examples
use ailloli_ui_widgets::controls::AutocompleteItem;
let item = AutocompleteItem::new("Unavailable").disabled(true);
let _ = item;Sourcepub fn disabled_signal(self, disabled: Memo<bool>) -> Self
pub fn disabled_signal(self, disabled: Memo<bool>) -> Self
Uses a memo as the reactive disabled binding.
§Examples
use ailloli_ui_runtime::component::Memo;
use ailloli_ui_widgets::controls::AutocompleteItem;
let item = AutocompleteItem::new("Apple").disabled_signal(Memo::new(|| false));
let _ = item;Sourcepub fn leading_icon(self, icon: IconId) -> Self
pub fn leading_icon(self, icon: IconId) -> Self
Sets the leading icon, replacing any previous one.
§Examples
use ailloli_ui_core::IconId;
use ailloli_ui_widgets::controls::AutocompleteItem;
let item = AutocompleteItem::new("History").leading_icon(IconId::History);
let _ = item;Trait Implementations§
Source§impl Clone for AutocompleteItem
impl Clone for AutocompleteItem
Source§fn clone(&self) -> AutocompleteItem
fn clone(&self) -> AutocompleteItem
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AutocompleteItem
impl !RefUnwindSafe for AutocompleteItem
impl !Send for AutocompleteItem
impl !Sync for AutocompleteItem
impl Unpin for AutocompleteItem
impl !UnwindSafe for AutocompleteItem
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.