CompositeDisposable
struct · ferroui-base · v0.5.0
struct CompositeDisposable
A group of disposables that are disposed together.
Members
newwith_capacityfrom_disposablesis_disposedcountaddremovecontainscopy_tois_read_onlyget_enumeratorclear
new
fn new() -> Self
with_capacity
fn with_capacity(capacity: usize) -> Self
from_disposables
fn from_disposables(disposables: impl IntoIterator<Item = Rc<dyn IDisposable>>) -> Self
is_disposed
fn is_disposed(self: &Self) -> bool
count
fn count(self: &Self) -> usize
add
fn add(self: &Self, item: Rc<dyn IDisposable>)
Adds a disposable to the group, or disposes it immediately if the group has already been disposed.
remove
fn remove(self: &Self, item: &Rc<dyn IDisposable>) -> bool
Removes and disposes the first occurrence of item.
contains
fn contains(self: &Self, item: &Rc<dyn IDisposable>) -> bool
Whether the group contains item. A disposed group is empty.
copy_to
fn copy_to(self: &Self, array: &mut [Rc<dyn IDisposable>], array_index: usize)
Copies the disposables of the group over the items of array that
start at array_index. A disposed group copies nothing.
Panics when array_index is outside of the array or the array has
not enough room after it.
is_read_only
fn is_read_only(self: &Self) -> bool
Always false.
get_enumerator
fn get_enumerator(self: &Self) -> std::vec::IntoIter<Rc<dyn IDisposable>>
Enumerates a copy of the disposables of the group. A disposed group is empty.
clear
fn clear(self: &Self)
Disposes and removes all items without disposing the group itself.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherDefaultIDisposable
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.