Trait P2pConnectionService

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§

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

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

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.

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.

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>

Implementors§