SingleAssignmentDisposableValue
struct · ferroui-reactive · v0.5.0
struct SingleAssignmentDisposableValue
A slot for a disposable that can be assigned once (SingleAssignmentDisposableValue). A
disposable assigned after the slot was disposed is disposed at once; a second assignment panics,
where upstream throws InvalidOperationException.
Members
new
const fn new() -> Self
is_disposed
fn is_disposed(self: &Self) -> bool
Whether the slot has been disposed.
disposable
fn disposable(self: &Self) -> Option<Rc<dyn IDisposable>>
The assigned disposable, if any (none once the slot is disposed).
set_disposable
fn set_disposable(self: &Self, value: Option<Rc<dyn IDisposable>>)
Assigns the disposable. Panics when one was assigned already.
dispose
fn dispose(self: &Self)
Disposes the slot and the disposable it holds.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.