Skip to main content

ControlHandler

Trait ControlHandler 

Source
pub trait ControlHandler: Sync {
Show 30 methods // Required methods fn status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<StatusResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn config_get<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ConfigResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn config_set_upstream<'life0, 'async_trait>( &'life0 self, params: SetUpstreamParams, ) -> Pin<Box<dyn Future<Output = Result<SetUpstreamResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn log_set_level<'life0, 'async_trait>( &'life0 self, params: SetLevelParams, ) -> Pin<Box<dyn Future<Output = Result<SetLevelResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn cache_get<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<CacheView, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn cache_set_cap<'life0, 'async_trait>( &'life0 self, params: SetCapParams, ) -> Pin<Box<dyn Future<Output = Result<SetCapResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn cache_clear<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<CacheClearResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn hosted_stores_list<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<HostedStoresListResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn hosted_stores_pin<'life0, 'async_trait>( &'life0 self, params: PinParams, ) -> Pin<Box<dyn Future<Output = Result<PinResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn hosted_stores_unpin<'life0, 'async_trait>( &'life0 self, params: UnpinParams, ) -> Pin<Box<dyn Future<Output = Result<UnpinResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn hosted_stores_status<'life0, 'async_trait>( &'life0 self, params: HostedStoreStatusParams, ) -> Pin<Box<dyn Future<Output = Result<HostedStoreStatusResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn sync_status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<SyncStatusResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn sync_trigger<'life0, 'async_trait>( &'life0 self, params: SyncTriggerParams, ) -> Pin<Box<dyn Future<Output = Result<SyncTriggerResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn updater_status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Value, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn updater_set_channel<'life0, 'async_trait>( &'life0 self, params: SetChannelParams, ) -> Pin<Box<dyn Future<Output = Result<Value, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn updater_pause<'life0, 'async_trait>( &'life0 self, params: PauseParams, ) -> Pin<Box<dyn Future<Output = Result<Value, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn updater_resume<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Value, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn updater_check_now<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Value, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pairing_list<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Value, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pairing_approve<'life0, 'async_trait>( &'life0 self, params: ApproveParams, ) -> Pin<Box<dyn Future<Output = Result<PairingApproveResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pairing_revoke<'life0, 'async_trait>( &'life0 self, params: RevokeParams, ) -> Pin<Box<dyn Future<Output = Result<PairingRevokeResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn peer_status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Value, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn peers_connect<'life0, 'async_trait>( &'life0 self, params: PeersConnectParams, ) -> Pin<Box<dyn Future<Output = Result<PeersConnectResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn peers_disconnect<'life0, 'async_trait>( &'life0 self, params: PeersDisconnectParams, ) -> Pin<Box<dyn Future<Output = Result<PeersDisconnectResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn subscribe<'life0, 'async_trait>( &'life0 self, params: SubscribeParams, ) -> Pin<Box<dyn Future<Output = Result<SubscribeResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn unsubscribe<'life0, 'async_trait>( &'life0 self, params: UnsubscribeParams, ) -> Pin<Box<dyn Future<Output = Result<UnsubscribeResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn list_subscriptions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ListSubscriptionsResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pairing_request<'life0, 'async_trait>( &'life0 self, params: RequestParams, ) -> Pin<Box<dyn Future<Output = Result<PairingRequestResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pairing_poll<'life0, 'async_trait>( &'life0 self, params: PollParams, ) -> Pin<Box<dyn Future<Output = Result<PairingPollResult, ControlError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided method fn dispatch<'life0, 'async_trait>( &'life0 self, request: JsonRpcRequest, ) -> Pin<Box<dyn Future<Output = JsonRpcResponse> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}
Expand description

The node-facing half of the contract: a running node implements this to SERVE the control surface. Each method is typed to the catalog’s params/results; the provided dispatch routes a raw JsonRpcRequest to the right method so a server needs only one entry point and can never mis-route.

Open/proxied shapes (the updater beacon status, the pairing list, the peer-pool snapshot) return Value rather than a frozen struct, matching the catalog’s ControlCall::Output for those methods.

Required Methods§

Source

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

control.status

Source

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

control.config.get

Source

fn config_set_upstream<'life0, 'async_trait>( &'life0 self, params: SetUpstreamParams, ) -> Pin<Box<dyn Future<Output = Result<SetUpstreamResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.config.setUpstream

Source

fn log_set_level<'life0, 'async_trait>( &'life0 self, params: SetLevelParams, ) -> Pin<Box<dyn Future<Output = Result<SetLevelResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.log.setLevel

Source

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

control.cache.get

Source

fn cache_set_cap<'life0, 'async_trait>( &'life0 self, params: SetCapParams, ) -> Pin<Box<dyn Future<Output = Result<SetCapResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.cache.setCap

Source

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

control.cache.clear

Source

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

control.hostedStores.list

Source

fn hosted_stores_pin<'life0, 'async_trait>( &'life0 self, params: PinParams, ) -> Pin<Box<dyn Future<Output = Result<PinResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.hostedStores.pin

Source

fn hosted_stores_unpin<'life0, 'async_trait>( &'life0 self, params: UnpinParams, ) -> Pin<Box<dyn Future<Output = Result<UnpinResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.hostedStores.unpin

Source

fn hosted_stores_status<'life0, 'async_trait>( &'life0 self, params: HostedStoreStatusParams, ) -> Pin<Box<dyn Future<Output = Result<HostedStoreStatusResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.hostedStores.status

Source

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

control.sync.status

Source

fn sync_trigger<'life0, 'async_trait>( &'life0 self, params: SyncTriggerParams, ) -> Pin<Box<dyn Future<Output = Result<SyncTriggerResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.sync.trigger

Source

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

control.updater.status

Source

fn updater_set_channel<'life0, 'async_trait>( &'life0 self, params: SetChannelParams, ) -> Pin<Box<dyn Future<Output = Result<Value, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.updater.setChannel

Source

fn updater_pause<'life0, 'async_trait>( &'life0 self, params: PauseParams, ) -> Pin<Box<dyn Future<Output = Result<Value, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.updater.pause

Source

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

control.updater.resume

Source

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

control.updater.checkNow

Source

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

control.pairing.list

Source

fn pairing_approve<'life0, 'async_trait>( &'life0 self, params: ApproveParams, ) -> Pin<Box<dyn Future<Output = Result<PairingApproveResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.pairing.approve

Source

fn pairing_revoke<'life0, 'async_trait>( &'life0 self, params: RevokeParams, ) -> Pin<Box<dyn Future<Output = Result<PairingRevokeResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.pairing.revoke

Source

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

control.peerStatus

Source

fn peers_connect<'life0, 'async_trait>( &'life0 self, params: PeersConnectParams, ) -> Pin<Box<dyn Future<Output = Result<PeersConnectResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.peers.connect

Source

fn peers_disconnect<'life0, 'async_trait>( &'life0 self, params: PeersDisconnectParams, ) -> Pin<Box<dyn Future<Output = Result<PeersDisconnectResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.peers.disconnect

Source

fn subscribe<'life0, 'async_trait>( &'life0 self, params: SubscribeParams, ) -> Pin<Box<dyn Future<Output = Result<SubscribeResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.subscribe

Source

fn unsubscribe<'life0, 'async_trait>( &'life0 self, params: UnsubscribeParams, ) -> Pin<Box<dyn Future<Output = Result<UnsubscribeResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

control.unsubscribe

Source

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

control.listSubscriptions

Source

fn pairing_request<'life0, 'async_trait>( &'life0 self, params: RequestParams, ) -> Pin<Box<dyn Future<Output = Result<PairingRequestResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

pairing.request (OPEN)

Source

fn pairing_poll<'life0, 'async_trait>( &'life0 self, params: PollParams, ) -> Pin<Box<dyn Future<Output = Result<PairingPollResult, ControlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

pairing.poll (OPEN)

Provided Methods§

Source

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

Route a raw JSON-RPC request to the right typed method and build the response envelope.

Deserializes the params for methods that take them, calls the handler, and serializes the typed result. An unknown method → METHOD_NOT_FOUND; malformed params → INVALID_PARAMS. This is the single seam a server dispatches through — the KATs exercise it end-to-end.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§