pub trait DropdownDelegate: Sized {
type Item: DropdownItem;
// Required methods
fn items_count(&self, section: usize) -> usize;
fn item(&self, ix: IndexPath) -> Option<&Self::Item>;
fn position<V>(&self, _value: &V) -> Option<IndexPath>
where Self::Item: DropdownItem<Value = V>,
V: PartialEq;
// Provided methods
fn sections_count(&self, _: &App) -> usize { ... }
fn section(&self, _section: usize) -> Option<AnyElement> { ... }
fn searchable(&self) -> bool { ... }
fn perform_search(
&mut self,
_query: &str,
_window: &mut Window,
_: &mut App,
) -> Task<()> { ... }
}
Required Associated Types§
type Item: DropdownItem
Required Methods§
Sourcefn items_count(&self, section: usize) -> usize
fn items_count(&self, section: usize) -> usize
Returns the number of items in the given section.
Provided Methods§
Sourcefn sections_count(&self, _: &App) -> usize
fn sections_count(&self, _: &App) -> usize
Returns the number of sections in the dropdown.
Sourcefn section(&self, _section: usize) -> Option<AnyElement>
fn section(&self, _section: usize) -> Option<AnyElement>
Returns the section header element for the given section index.
fn searchable(&self) -> bool
fn perform_search( &mut self, _query: &str, _window: &mut Window, _: &mut App, ) -> Task<()>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.