pub trait SingleTerminate: Send + Sync {
// Required method
fn terminate_proc<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
cx: &'life1 (impl 'async_trait + Actor),
proc: &'life2 ProcAddr,
timeout: Duration,
reason: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<ActorAddr>, Vec<ActorAddr>), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
}Expand description
Trait for terminating a single proc.
Required Methods§
Sourcefn terminate_proc<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
cx: &'life1 (impl 'async_trait + Actor),
proc: &'life2 ProcAddr,
timeout: Duration,
reason: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<ActorAddr>, Vec<ActorAddr>), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn terminate_proc<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
cx: &'life1 (impl 'async_trait + Actor),
proc: &'life2 ProcAddr,
timeout: Duration,
reason: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<ActorAddr>, Vec<ActorAddr>), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Gracefully terminate the given proc.
Initiates a polite shutdown for the child, waits up to timeout for
completion, then escalates to a forceful stop.
Implementation notes:
- “Polite shutdown” and “forceful stop” are intentionally abstract. Implementors should map these to whatever semantics they control (e.g., proc-level drain/abort, RPCs, OS signals).
- The operation must be idempotent and tolerate races with concurrent termination or external exits.
§Parameters
timeout: Per-child grace period before escalation to a forceful stop.reason: Human-readable reason for termination. Returns a tuple of (polite shutdown actors vec, forceful stop actors vec)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".