pub struct EffectHandle { /* private fields */ }Expand description
A cloneable handle to one registered effect.
Dropping a handle does not dispose the effect: ownership belongs to the
fiber. Call EffectHandle::dispose for early cleanup, or dispose the
owning fiber.
Implementations§
Source§impl EffectHandle
impl EffectHandle
Sourcepub fn dispose(&self) -> Result<()>
pub fn dispose(&self) -> Result<()>
Dispose this effect synchronously, waiting for asynchronous cleanup.
Sourcepub async fn dispose_async(&self) -> Result<()>
pub async fn dispose_async(&self) -> Result<()>
Dispose this effect asynchronously.
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Stop owning this effect without running its cleanup callback.
This is intended for framework structural effects. Application code
normally wants dispose.
Sourcepub fn adopt(&self, child: EffectHandle) -> Result<()>
pub fn adopt(&self, child: EffectHandle) -> Result<()>
Move child under this effect’s diagnostic and disposal tree.
Sourcepub fn meta(&self) -> EffectMeta
pub fn meta(&self) -> EffectMeta
Return a snapshot of diagnostic metadata.
Sourcepub fn is_disposed(&self) -> bool
pub fn is_disposed(&self) -> bool
Whether cleanup has already started.
Trait Implementations§
Source§impl Clone for EffectHandle
impl Clone for EffectHandle
Source§fn clone(&self) -> EffectHandle
fn clone(&self) -> EffectHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for EffectHandle
impl !UnwindSafe for EffectHandle
impl Freeze for EffectHandle
impl Send for EffectHandle
impl Sync for EffectHandle
impl Unpin for EffectHandle
impl UnsafeUnpin for EffectHandle
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