pub trait CapabilityEffect: Send + 'static {
// Required methods
fn name(&self) -> &str;
fn close<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), CapabilityEffectError>> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
One reversible resource owned by exactly one capability scope.
Implementations must make close idempotent at the underlying resource
boundary. The supervisor calls effects in reverse registration order and
keeps proceeding after an individual failure. Teardown must use asynchronous
I/O and yield normally; blocking a Tokio worker violates the scope close
contract.
Required Methods§
fn name(&self) -> &str
fn close<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), CapabilityEffectError>> + Send + 'async_trait>>where
Self: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".