Trait snarkos_node::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.

Object Safety§

This trait is not object safe.

Implementors§