ControlService

Trait ControlService 

Source
pub trait ControlService: Sized {
    // Required methods
    async fn resolve_addrs(
        self,
        context: Context,
        peers: HashSet<AgentId>,
    ) -> Result<HashMap<AgentId, IpAddr>, ResolveError>;
    async fn get_env_info(
        self,
        context: Context,
        env_id: EnvId,
    ) -> Option<EnvInfo>;
    async fn post_transfer_status(
        self,
        context: Context,
        id: u32,
        status: TransferStatusUpdate,
    );
    async fn post_transfer_statuses(
        self,
        context: Context,
        statuses: Vec<(u32, TransferStatus)>,
    );
    async fn post_block_status(
        self,
        context: Context,
        height: u32,
        timestamp: i64,
        state_root: String,
        block_hash: String,
        prev_block_hash: String,
    );
    async fn post_node_status(self, context: Context, update: NodeStatus);

    // Provided method
    fn serve(self) -> ServeControlService<Self> { ... }
}

Required Methods§

Source

async fn resolve_addrs( self, context: Context, peers: HashSet<AgentId>, ) -> Result<HashMap<AgentId, IpAddr>, ResolveError>

Resolve the addresses of the given agents.

Source

async fn get_env_info(self, context: Context, env_id: EnvId) -> Option<EnvInfo>

Get the environment info for the given environment.

Source

async fn post_transfer_status( self, context: Context, id: u32, status: TransferStatusUpdate, )

Emit an agent transfer status update.

Source

async fn post_transfer_statuses( self, context: Context, statuses: Vec<(u32, TransferStatus)>, )

Emit current agent transfers. Will overwrite old status.

Source

async fn post_block_status( self, context: Context, height: u32, timestamp: i64, state_root: String, block_hash: String, prev_block_hash: String, )

Emit an agent block status update.

Source

async fn post_node_status(self, context: Context, update: NodeStatus)

Emit an agent node status update.

Provided Methods§

Source

fn serve(self) -> ServeControlService<Self>

Returns a serving function to use with InFlightRequest::execute.

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§