Skip to main content

CmdServer

Trait CmdServer 

Source
pub trait CmdServer<LEN: RawEncode + for<'a> RawDecode<'a> + Copy + RawFixedBytes + Sync + Send + 'static + FromPrimitive + ToPrimitive, CMD: RawEncode + for<'a> RawDecode<'a> + Copy + RawFixedBytes + Sync + Send + 'static + Eq + Hash>:
    'static
    + Send
    + Sync {
Show 20 methods // Required methods fn register_cmd_handler(&self, cmd: CMD, handler: impl CmdHandler<LEN, CMD>); fn send<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn send_with_resp<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [u8], timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn send_parts<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn send_parts_with_resp<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn send_cmd<'life0, 'life1, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: CmdBody, ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn send_cmd_with_resp<'life0, 'life1, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: CmdBody, timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn send_by_specify_tunnel<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn send_by_specify_tunnel_with_resp<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: &'life2 [u8], timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn send_parts_by_specify_tunnel<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn send_parts_by_specify_tunnel_with_resp<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn send_cmd_by_specify_tunnel<'life0, 'life1, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: CmdBody, ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn send_cmd_by_specify_tunnel_with_resp<'life0, 'life1, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: CmdBody, timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn send_by_all_tunnels<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn send_parts_by_all_tunnels<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; // Provided methods fn send2<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn send2_with_resp<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn send2_by_specify_tunnel<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn send2_by_specify_tunnel_with_resp<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn send2_by_all_tunnels<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... }
}

Required Methodsยง

Source

fn register_cmd_handler(&self, cmd: CMD, handler: impl CmdHandler<LEN, CMD>)

Source

fn send<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn send_with_resp<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [u8], timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn send_parts<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn send_parts_with_resp<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn send_cmd<'life0, 'life1, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: CmdBody, ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn send_cmd_with_resp<'life0, 'life1, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: CmdBody, timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn send_by_specify_tunnel<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn send_by_specify_tunnel_with_resp<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: &'life2 [u8], timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn send_parts_by_specify_tunnel<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn send_parts_by_specify_tunnel_with_resp<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn send_cmd_by_specify_tunnel<'life0, 'life1, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: CmdBody, ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn send_cmd_by_specify_tunnel_with_resp<'life0, 'life1, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: CmdBody, timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn send_by_all_tunnels<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn send_parts_by_all_tunnels<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Provided Methodsยง

Source

fn send2<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

๐Ÿ‘ŽDeprecated:

use send_parts instead

Source

fn send2_with_resp<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

๐Ÿ‘ŽDeprecated:

use send_parts_with_resp instead

Source

fn send2_by_specify_tunnel<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

๐Ÿ‘ŽDeprecated:

use send_parts_by_specify_tunnel instead

Source

fn send2_by_specify_tunnel_with_resp<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, tunnel_id: TunnelId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], timeout: Duration, ) -> Pin<Box<dyn Future<Output = CmdResult<CmdBody>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

๐Ÿ‘ŽDeprecated:

use send_parts_by_specify_tunnel_with_resp instead

Source

fn send2_by_all_tunnels<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, peer_id: &'life1 PeerId, cmd: CMD, version: u8, body: &'life2 [&'life3 [u8]], ) -> Pin<Box<dyn Future<Output = CmdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

๐Ÿ‘ŽDeprecated:

use send_parts_by_all_tunnels instead

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ยง

Sourceยง

impl<M: CmdTunnelMeta, R: CmdTunnelRead<M>, W: CmdTunnelWrite<M>, LEN: RawEncode + for<'a> RawDecode<'a> + Copy + RawFixedBytes + Sync + Send + 'static + FromPrimitive + ToPrimitive, CMD: RawEncode + for<'a> RawDecode<'a> + Copy + RawFixedBytes + Sync + Send + 'static + Eq + Hash + Debug> CmdServer<LEN, CMD> for DefaultCmdServerService<M, R, W, LEN, CMD>

Sourceยง

impl<M: CmdTunnelMeta, R: CmdTunnelRead<M>, W: CmdTunnelWrite<M>, LEN: RawEncode + for<'a> RawDecode<'a> + Copy + RawFixedBytes + Sync + Send + 'static + FromPrimitive + ToPrimitive, CMD: RawEncode + for<'a> RawDecode<'a> + Copy + RawFixedBytes + Sync + Send + 'static + Eq + Hash + Debug, LISTENER: CmdTunnelListener<M, R, W>> CmdServer<LEN, CMD> for DefaultCmdServer<M, R, W, LEN, CMD, LISTENER>