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: EncryptableType>(
&mut self,
other_pk: &PublicKey,
message: &T,
) -> Result<T::Encrypted, Box<dyn Error>>;
fn decrypt<T: EncryptableType>(
&mut self,
other_pk: &PublicKey,
encrypted: &T::Encrypted,
) -> Result<T, Box<dyn Error>>;
}
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: EncryptableType>( &mut self, other_pk: &PublicKey, message: &T, ) -> Result<T::Encrypted, Box<dyn Error>>
fn decrypt<T: EncryptableType>( &mut self, other_pk: &PublicKey, encrypted: &T::Encrypted, ) -> Result<T, Box<dyn Error>>
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.