Trait P2pConnectionService

Source
pub trait P2pConnectionService: Service {
    // Required methods
    fn connections(&self) -> BTreeSet<PeerId>;
    fn random_pick(
        &mut self,
        list: &[P2pConnectionOutgoingInitOpts],
    ) -> Option<P2pConnectionOutgoingInitOpts>;
    fn outgoing_init(&mut self, opts: P2pConnectionOutgoingInitOpts);
    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 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>;
}

Required Methods§

Source

fn connections(&self) -> BTreeSet<PeerId>

Source

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

Source

fn outgoing_init(&mut self, opts: P2pConnectionOutgoingInitOpts)

Initiates an outgoing connection and creates an offer sdp, which will be received in the state machine as an event.

Source

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

Initiates an incoming connection and creates an answer sdp, which will be received in the state machine as an event.

Source

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

Source

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

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>

Implementors§