pub struct CompositeDisposable { /* private fields */ }Expand description
A group of disposables that are disposed together.
Implementations§
Source§impl CompositeDisposable
impl CompositeDisposable
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn from_disposables( disposables: impl IntoIterator<Item = Rc<dyn IDisposable>>, ) -> Self
pub fn is_disposed(&self) -> bool
pub fn count(&self) -> usize
Sourcepub fn add(&self, item: Rc<dyn IDisposable>)
pub fn add(&self, item: Rc<dyn IDisposable>)
Adds a disposable to the group, or disposes it immediately if the group has already been disposed.
Sourcepub fn remove(&self, item: &Rc<dyn IDisposable>) -> bool
pub fn remove(&self, item: &Rc<dyn IDisposable>) -> bool
Removes and disposes the first occurrence of item.
Sourcepub fn contains(&self, item: &Rc<dyn IDisposable>) -> bool
pub fn contains(&self, item: &Rc<dyn IDisposable>) -> bool
Whether the group contains item. A disposed group is empty.
Sourcepub fn copy_to(&self, array: &mut [Rc<dyn IDisposable>], array_index: usize)
pub fn copy_to(&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.
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Always false.
Sourcepub fn get_enumerator(&self) -> IntoIter<Rc<dyn IDisposable>> ⓘ
pub fn get_enumerator(&self) -> IntoIter<Rc<dyn IDisposable>> ⓘ
Enumerates a copy of the disposables of the group. A disposed group is empty.
Trait Implementations§
Source§impl Default for CompositeDisposable
impl Default for CompositeDisposable
Source§impl IDisposable for CompositeDisposable
impl IDisposable for CompositeDisposable
Auto Trait Implementations§
impl !Freeze for CompositeDisposable
impl !RefUnwindSafe for CompositeDisposable
impl !Send for CompositeDisposable
impl !Sync for CompositeDisposable
impl !UnwindSafe for CompositeDisposable
impl Unpin for CompositeDisposable
impl UnsafeUnpin for CompositeDisposable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
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