Trait P2pChannelsService
pub trait P2pChannelsService: Service {
// Required methods
fn channel_open(&mut self, peer_id: PeerId, id: ChannelId);
fn channel_send(&mut self, peer_id: PeerId, msg_id: MsgId, msg: ChannelMsg);
fn encrypt<T>(
&mut self,
other_pk: &PublicKey,
message: &T,
) -> Result<<T as EncryptableType>::Encrypted, Box<dyn Error>>
where T: EncryptableType;
fn decrypt<T>(
&mut self,
other_pk: &PublicKey,
encrypted: &<T as EncryptableType>::Encrypted,
) -> Result<T, Box<dyn Error>>
where T: EncryptableType;
}
Required Methods§
fn channel_open(&mut self, peer_id: PeerId, id: ChannelId)
fn channel_send(&mut self, peer_id: PeerId, msg_id: MsgId, msg: ChannelMsg)
fn encrypt<T>(
&mut self,
other_pk: &PublicKey,
message: &T,
) -> Result<<T as EncryptableType>::Encrypted, Box<dyn Error>>where
T: EncryptableType,
fn decrypt<T>(
&mut self,
other_pk: &PublicKey,
encrypted: &<T as EncryptableType>::Encrypted,
) -> Result<T, Box<dyn Error>>where
T: EncryptableType,
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.