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§
Sourceasync fn resolve_addrs(
self,
context: Context,
peers: HashSet<AgentId>,
) -> Result<HashMap<AgentId, IpAddr>, ResolveError>
async fn resolve_addrs( self, context: Context, peers: HashSet<AgentId>, ) -> Result<HashMap<AgentId, IpAddr>, ResolveError>
Resolve the addresses of the given agents.
Sourceasync fn get_env_info(self, context: Context, env_id: EnvId) -> Option<EnvInfo>
async fn get_env_info(self, context: Context, env_id: EnvId) -> Option<EnvInfo>
Get the environment info for the given environment.
Sourceasync fn post_transfer_status(
self,
context: Context,
id: u32,
status: TransferStatusUpdate,
)
async fn post_transfer_status( self, context: Context, id: u32, status: TransferStatusUpdate, )
Emit an agent transfer status update.
Sourceasync fn post_transfer_statuses(
self,
context: Context,
statuses: Vec<(u32, TransferStatus)>,
)
async fn post_transfer_statuses( self, context: Context, statuses: Vec<(u32, TransferStatus)>, )
Emit current agent transfers. Will overwrite old status.
Sourceasync fn post_block_status(
self,
context: Context,
height: u32,
timestamp: i64,
state_root: String,
block_hash: String,
prev_block_hash: String,
)
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.
Sourceasync fn post_node_status(self, context: Context, update: NodeStatus)
async fn post_node_status(self, context: Context, update: NodeStatus)
Emit an agent node status update.
Provided Methods§
Sourcefn serve(self) -> ServeControlService<Self>
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.