pub trait N0de:
'static
+ Send
+ Sync {
// Required method
fn spawn(
endpoint: Endpoint,
metrics: &mut Registry,
) -> impl Future<Output = Result<Self>> + Send
where Self: Sized;
// Provided method
fn shutdown(&mut self) -> impl Future<Output = Result<()>> + Send { ... }
}
Expand description
A trait for nodes that can be spawned and shut down
Required Methods§
fn spawn(
endpoint: Endpoint,
metrics: &mut Registry,
) -> impl Future<Output = Result<Self>> + Sendwhere
Self: Sized,
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.