[][src]Function skyway_webrtc_gateway_api::data::connect

pub async fn connect(query: ConnectQuery) -> Result<DataConnectionId, Error>

This function let a WebRTC Gateway establish a DataChannel to neighbour

Examples

use skyway_webrtc_gateway_api::data::ConnectQuery;
use skyway_webrtc_gateway_api::prelude::{PeerId, Token};

let query = ConnectQuery {
    peer_id: PeerId::new("peer_id"),
    token: Token::new("test-token"),
    options: None,
    target_id: PeerId::new("target_id"),
    params: None,
    redirect_params: None,
};