pub struct Disposer {
pub inner: Component,
/* private fields */
}
Expand description
A component that manages a set of Disposable objects. When this component is removed from its owner, all managed Disposables are disposed.
Fields
inner: Component
Implementations
sourceimpl Disposer
impl Disposer
pub fn new() -> Disposer
sourcepub fn add(
&mut self,
disposable: Box<dyn Disposable + 'static, Global>
) -> &Disposer
pub fn add(
&mut self,
disposable: Box<dyn Disposable + 'static, Global>
) -> &Disposer
Add a Disposable, so that it also gets disposed when this component does. @returns This instance, for chaining.
sourcepub fn remove(&self, disposable: impl Disposable)
pub fn remove(&self, disposable: impl Disposable)
Remove a Disposable from this disposer. @returns True if the disposable was removed.
sourcepub fn connect0(
&mut self,
signal: Signal0,
listener: Box<dyn Fn() + 'static, Global>
) -> &Disposer
pub fn connect0(
&mut self,
signal: Signal0,
listener: Box<dyn Fn() + 'static, Global>
) -> &Disposer
Chainable convenience method for connecting a signal listener and adding its SignalConnection to this disposer. @returns This instance, for chaining.
sourcepub fn connect1<A>(
&mut self,
signal: Signal1<A>,
listener: Box<dyn Fn(&A) + 'static, Global>
) -> &Disposer
pub fn connect1<A>(
&mut self,
signal: Signal1<A>,
listener: Box<dyn Fn(&A) + 'static, Global>
) -> &Disposer
Chainable convenience method for connecting a signal listener and adding its SignalConnection to this disposer. @returns This instance, for chaining.
sourcepub fn connect2<A, B>(
&mut self,
signal: Signal2<A, B>,
listener: Rc<dyn Fn(&A, &B) + 'static>
) -> &Disposer
pub fn connect2<A, B>(
&mut self,
signal: Signal2<A, B>,
listener: Rc<dyn Fn(&A, &B) + 'static>
) -> &Disposer
Chainable convenience method for connecting a signal listener and adding its SignalConnection to this disposer. @returns This instance, for chaining.
pub fn on_removed(&mut self)
pub fn dispose(&mut self)
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Disposer
impl !Send for Disposer
impl !Sync for Disposer
impl Unpin for Disposer
impl !UnwindSafe for Disposer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
fn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.