Trait N0de

Source
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§

Source

fn spawn( endpoint: Endpoint, metrics: &mut Registry, ) -> impl Future<Output = Result<Self>> + Send
where Self: Sized,

Provided Methods§

Source

fn shutdown(&mut self) -> impl Future<Output = Result<()>> + Send

Asynchronously shut down the node

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.

Implementors§