Struct 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

Source§

type Item = u32

The type of the elements being iterated over.
Source§

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>,

Source§

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>,

Source§

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.