Skip to main content

BindableList

Struct BindableList 

Source
pub struct BindableList<T: PropertyValue> { /* private fields */ }
Expand description

A notifying list that bindings can index into: a FerroList together with the untyped change event that binding indexers subscribe to.

As a model object it has identity equality.

Implementations§

Source§

impl<T: PropertyValue> BindableList<T>

Source

pub fn new(items: impl IntoIterator<Item = T>) -> Rc<Self>

Creates a list with the given items.

Source

pub fn items(&self) -> &FerroList<T>

The typed list.

Trait Implementations§

Source§

impl<T: PropertyValue> IBindableList for BindableList<T>

Source§

fn count(&self) -> usize

The number of items.
Source§

fn item_type(&self) -> ValueType

The type of the items.
Source§

fn get_item(&self, index: usize) -> Option<BoxedValue>

The item at index as an untyped value, or None if out of range.
Source§

fn set_item(&self, index: usize, value: &BoxedValue) -> bool

Replaces the item at index. Returns false if the index is out of range, the list is read-only or the value is of the wrong type.
Source§

fn as_notify_collection_changed(&self) -> Option<&dyn INotifyCollectionChanged>

The change notifications of the list, if it is a notifying list.
Source§

impl<T: PropertyValue> INotifyCollectionChanged for BindableList<T>

Source§

fn collection_changed(&self) -> &Event<CollectionChange>

The event raised when the collection changes.
Source§

impl<T: PropertyValue> PartialEq for BindableList<T>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for BindableList<T>

§

impl<T> !RefUnwindSafe for BindableList<T>

§

impl<T> !Send for BindableList<T>

§

impl<T> !Sync for BindableList<T>

§

impl<T> !UnwindSafe for BindableList<T>

§

impl<T> Unpin for BindableList<T>
where FerroList<T>: Unpin,

§

impl<T> UnsafeUnpin for BindableList<T>

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> AnyValue for T
where T: PartialEq + 'static,

Source§

fn any_value_as_any(&self) -> &(dyn Any + 'static)

Source§

fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool

Source§

fn any_value_type_name(&self) -> &'static str

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> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.