Trait P2pServiceWebrtc

Source
pub trait P2pServiceWebrtc: Service {
    type Event: From<P2pEvent> + Send + Sync + 'static;

Show 17 methods // Required methods fn random_pick( &mut self, list: &[P2pConnectionOutgoingInitOpts], ) -> Option<P2pConnectionOutgoingInitOpts>; fn event_sender(&self) -> &UnboundedSender<Self::Event>; fn cmd_sender(&self) -> &UnboundedSender<Tracked<Cmd>>; fn peers(&mut self) -> &mut BTreeMap<PeerId, PeerState>; 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_pub_key: &PublicKey, encrypted: &<T as EncryptableType>::Encrypted, ) -> Result<T, Box<dyn Error>> where T: EncryptableType; fn auth_encrypt_and_send( &mut self, peer_id: PeerId, other_pub_key: &PublicKey, auth: ConnectionAuth, ); fn auth_decrypt( &mut self, other_pub_key: &PublicKey, auth: ConnectionAuthEncrypted, ) -> Option<ConnectionAuth>; // Provided methods fn init<S>( secret_key: SecretKey, spawner: S, rng_seed: [u8; 32], ) -> P2pServiceCtx where S: TaskSpawner { ... } fn outgoing_init(&mut self, peer_id: PeerId) { ... } fn incoming_init(&mut self, peer_id: PeerId, offer: Offer) { ... } fn set_answer(&mut self, peer_id: PeerId, answer: Answer) { ... } fn http_signaling_request(&mut self, url: String, offer: Offer) { ... } fn disconnect(&mut self, peer_id: PeerId) -> bool { ... } fn channel_open(&mut self, peer_id: PeerId, id: ChannelId) { ... } fn channel_send(&mut self, peer_id: PeerId, msg_id: MsgId, msg: ChannelMsg) { ... } fn auth_send( &mut self, peer_id: PeerId, _other_pub_key: &PublicKey, auth: Option<ConnectionAuthEncrypted>, ) { ... }
}

Required Associated Types§

Source

type Event: From<P2pEvent> + Send + Sync + 'static

Required Methods§

Source

fn random_pick( &mut self, list: &[P2pConnectionOutgoingInitOpts], ) -> Option<P2pConnectionOutgoingInitOpts>

Source

fn event_sender(&self) -> &UnboundedSender<Self::Event>

Source

fn cmd_sender(&self) -> &UnboundedSender<Tracked<Cmd>>

Source

fn peers(&mut self) -> &mut BTreeMap<PeerId, PeerState>

Source

fn encrypt<T>( &mut self, other_pk: &PublicKey, message: &T, ) -> Result<<T as EncryptableType>::Encrypted, Box<dyn Error>>
where T: EncryptableType,

Source

fn decrypt<T>( &mut self, other_pub_key: &PublicKey, encrypted: &<T as EncryptableType>::Encrypted, ) -> Result<T, Box<dyn Error>>
where T: EncryptableType,

Source

fn auth_encrypt_and_send( &mut self, peer_id: PeerId, other_pub_key: &PublicKey, auth: ConnectionAuth, )

Source

fn auth_decrypt( &mut self, other_pub_key: &PublicKey, auth: ConnectionAuthEncrypted, ) -> Option<ConnectionAuth>

Provided Methods§

Source

fn init<S>( secret_key: SecretKey, spawner: S, rng_seed: [u8; 32], ) -> P2pServiceCtx
where S: TaskSpawner,

Source

fn outgoing_init(&mut self, peer_id: PeerId)

Source

fn incoming_init(&mut self, peer_id: PeerId, offer: Offer)

Source

fn set_answer(&mut self, peer_id: PeerId, answer: Answer)

Source

fn http_signaling_request(&mut self, url: String, offer: Offer)

Source

fn disconnect(&mut self, peer_id: PeerId) -> bool

Source

fn channel_open(&mut self, peer_id: PeerId, id: ChannelId)

Source

fn channel_send(&mut self, peer_id: PeerId, msg_id: MsgId, msg: ChannelMsg)

Source

fn auth_send( &mut self, peer_id: PeerId, _other_pub_key: &PublicKey, auth: Option<ConnectionAuthEncrypted>, )

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§