pub trait ClientLifecycle: MaybeSendSync {
// Provided methods
fn install<'a>(&'a self, _client: Weak<Client>) -> BoxFuture<'a, Result<()>> { ... }
fn on_ready<'a>(
&'a self,
_scope: ConnectionScope,
) -> BoxFuture<'a, Result<()>> { ... }
fn on_closed<'a>(
&'a self,
_scope: ConnectionScope,
) -> BoxFuture<'a, Result<()>> { ... }
fn signal_shutdown(&self) { ... }
fn shutdown(&self) -> BoxFuture<'_, Result<()>> { ... }
}client-lifecycle only.Expand description
Aggregate lifecycle seam installed during Client construction.
Implementations must make install transactional. Connection callbacks are
serialized, with bounded ready work; connection cleanup only schedules
on_closed so a stalled extension cannot block reconnect. Closure callbacks
are lossless and may temporarily exceed the target capacity. A future plugin
host owns per-plugin ordering and isolation behind this client-level seam.
install receives a weak client reference so retaining it cannot create a cycle.
signal_shutdown is the non-blocking boundary for resources that must stop
even when an FFI host cannot await shutdown.
Provided Methods§
fn install<'a>(&'a self, _client: Weak<Client>) -> BoxFuture<'a, Result<()>>
fn on_ready<'a>(&'a self, _scope: ConnectionScope) -> BoxFuture<'a, Result<()>>
fn on_closed<'a>(&'a self, _scope: ConnectionScope) -> BoxFuture<'a, Result<()>>
Sourcefn signal_shutdown(&self)
fn signal_shutdown(&self)
Stop synchronously owned resources before asynchronous shutdown begins. Implementations must return promptly and make repeated calls harmless.
fn shutdown(&self) -> BoxFuture<'_, Result<()>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".