NodeInterface

Trait NodeInterface 

Source
pub trait NodeInterface<N: Network>: Routing<N> {
    // Required method
    fn shut_down<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn node_type(&self) -> NodeType { ... }
    fn private_key(&self) -> &PrivateKey<N> { ... }
    fn view_key(&self) -> &ViewKey<N> { ... }
    fn address(&self) -> Address<N> { ... }
    fn is_dev(&self) -> bool { ... }
    fn handle_signals(shutdown_flag: Arc<AtomicBool>) -> Arc<OnceCell<Self>> { ... }
}

Required Methods§

Source

fn shut_down<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Shuts down the node.

Provided Methods§

Source

fn node_type(&self) -> NodeType

Returns the node type.

Source

fn private_key(&self) -> &PrivateKey<N>

Returns the account private key of the node.

Source

fn view_key(&self) -> &ViewKey<N>

Returns the account view key of the node.

Source

fn address(&self) -> Address<N>

Returns the account address of the node.

Source

fn is_dev(&self) -> bool

Returns true if the node is in development mode.

Source

fn handle_signals(shutdown_flag: Arc<AtomicBool>) -> Arc<OnceCell<Self>>

Handles OS signals for the node to intercept and perform a clean shutdown. The optional shutdown_flag flag can be used to cleanly terminate the syncing process.

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§