Struct easy_imgui::SelectionBasicStorage

source ·
pub struct SelectionBasicStorage { /* private fields */ }
Expand description

Simple multi-selection storage facility.

By default it stores the indices in a collection. Use the with_callback_id() function to do something different.

Implementations§

source§

impl SelectionBasicStorage

source

pub fn new() -> Self

Creates a new selection storage.

By default the index is the ID.

source

pub fn with_callback_id<'a>( &'a mut self, f: impl FnMut(usize) -> ImGuiID + 'a, ) -> SelectionBasicStorageWithCallback<'a>

Decorates this storage with a map function.

The callback maps an index into an ID. This allows to re-sort the list without messing with the selection.

source

pub fn set_preserve_order(&mut self, preserve_order: bool)

source

pub fn contains(&self, id: ImGuiID) -> bool

source

pub fn clear(&mut self)

source

pub fn set_item_selected(&mut self, id: ImGuiID, selected: bool)

source

pub fn swap(&mut self, other: &mut SelectionBasicStorage)

source

pub fn iter(&self) -> SelectionBasicStorageIter<'_>

Trait Implementations§

source§

impl Default for SelectionBasicStorage

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a> IntoIterator for &'a SelectionBasicStorage

§

type Item = u32

The type of the elements being iterated over.
§

type IntoIter = SelectionBasicStorageIter<'a>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> SelectionBasicStorageIter<'a>

Creates an iterator from a value. Read more
source§

impl MultiSelectStorage for SelectionBasicStorage

source§

fn size(&self) -> Option<usize>

source§

fn apply_requests(&mut self, ms: &mut MultiSelect)

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.