Skip to main content

ReadOnlyObservableCollection

Struct ReadOnlyObservableCollection 

Source
pub struct ReadOnlyObservableCollection<T> { /* private fields */ }
Expand description

A read-only view of an observable collection (ReadOnlyObservableCollection<T>).

Implementations§

Source§

impl<T: Clone + PartialEq + 'static> ReadOnlyObservableCollection<T>

Source

pub fn new(collection: ObservableCollection<T>) -> Self

The view of collection (ReadOnlyObservableCollection(ObservableCollection<T>)).

Source

pub fn add_collection_changed( &self, handler: Rc<CollectionChangedHandler<T>>, ) -> u64

Adds a handler of the typed change notifications; returns the token that removes it (CollectionChanged +=).

Source

pub fn remove_collection_changed(&self, token: u64) -> bool

Removes a handler (CollectionChanged -=).

Source

pub fn count(&self) -> usize

The number of items (Count).

Source

pub fn is_empty(&self) -> bool

Source

pub fn get(&self, index: usize) -> T

The item at index (the indexer).

Source

pub fn items(&self) -> Ref<'_, Vec<T>>

The items, borrowed.

Source

pub fn to_vec(&self) -> Vec<T>

A copy of the items.

Source

pub fn contains(&self, item: &T) -> bool

Whether the collection has item (Contains).

Source

pub fn index_of(&self, item: &T) -> Option<usize>

The index of item (IndexOf).

Trait Implementations§

Source§

impl<T> Clone for ReadOnlyObservableCollection<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Clone + PartialEq + Debug + 'static> Debug for ReadOnlyObservableCollection<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Clone + PartialEq + 'static> From<&ObservableCollectionExtended<T>> for ReadOnlyObservableCollection<T>

Source§

fn from(collection: &ObservableCollectionExtended<T>) -> Self

The view of the collection (new ReadOnlyObservableCollection<T>(observableCollectionExtended)).

Source§

impl<T: Clone + PartialEq + 'static> From<ObservableCollection<T>> for ReadOnlyObservableCollection<T>

Source§

fn from(collection: ObservableCollection<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> INotifyCollectionChanged for ReadOnlyObservableCollection<T>

Source§

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

The event raised when the collection changes.
Source§

impl<T> INotifyPropertyChanged for ReadOnlyObservableCollection<T>

Source§

fn property_changed(&self) -> &Event<str>

The event raised when a property value changes.
Source§

fn as_notify_property_changing(&self) -> Option<&dyn INotifyPropertyChanging>

The object as INotifyPropertyChanging, when it also raises the event of a property that is about to change; None by default. Read more
Source§

impl<T: Clone + PartialEq + 'static> ObservableCollectionEx<T> for ReadOnlyObservableCollection<T>

Source§

fn notifying_collection(&self) -> ObservableCollection<T>

The observable collection whose changes are observed.
Source§

fn observe_collection_changes( &self, ) -> Rc<dyn IObservable<CollectionChangedEventPattern<T>>>

The notifications of the changes of the collection (ObserveCollectionChanges).
Source§

fn to_observable_change_set(&self) -> Rc<dyn IObservable<ChangeSet<T>>>

The items of the collection as change sets of a list: its items first, then each of its changes (ToObservableChangeSet<T>(), ToObservableChangeSet<TCollection, T>()).
Source§

fn to_observable_change_set_with_key<K: Eq + Hash + Clone + 'static>( &self, key_selector: impl Fn(&T) -> K + 'static, ) -> Rc<dyn IObservable<ChangeSet<T, K>>>

to_observable_change_set with each item keyed by key_selector (ToObservableChangeSet<TObject, TKey>(Func<TObject, TKey>)).
Source§

impl<T> PartialEq for ReadOnlyObservableCollection<T>

Source§

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

A view of the same collection.

1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.