pub struct Client { /* private fields */ }
Expand description
Relay service websocket client.
Implementations§
Source§impl NativeClient
impl NativeClient
Sourcepub async fn new(
server: &str,
options: ClientOptions,
) -> Result<(Self, NativeEventLoop)>
pub async fn new( server: &str, options: ClientOptions, ) -> Result<(Self, NativeEventLoop)>
Create a new native client.
Trait Implementations§
Source§impl Clone for NativeClient
impl Clone for NativeClient
Source§fn clone(&self) -> NativeClient
fn clone(&self) -> NativeClient
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl From<NativeClient> for Transport
impl From<NativeClient> for Transport
Source§impl NetworkTransport for NativeClient
impl NetworkTransport for NativeClient
Source§fn public_key(&self) -> &[u8] ⓘ
fn public_key(&self) -> &[u8] ⓘ
The public key for this client.
Source§fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform initial handshake with the server.
Source§fn connect_peer<'life0, 'life1, 'async_trait>(
&'life0 mut self,
public_key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connect_peer<'life0, 'life1, 'async_trait>(
&'life0 mut self,
public_key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handshake with a peer.
Peer already exists error is returned if this client is already connecting to the peer.
Source§fn send_json<'life0, 'life1, 'life2, 'async_trait, S>(
&'life0 mut self,
public_key: &'life1 [u8],
payload: &'life2 S,
session_id: Option<SessionId>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn send_json<'life0, 'life1, 'life2, 'async_trait, S>( &'life0 mut self, public_key: &'life1 [u8], payload: &'life2 S, session_id: Option<SessionId>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Send a JSON message to a peer via the relay service.
Source§fn send_blob<'life0, 'life1, 'async_trait>(
&'life0 mut self,
public_key: &'life1 [u8],
payload: Vec<u8>,
session_id: Option<SessionId>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_blob<'life0, 'life1, 'async_trait>(
&'life0 mut self,
public_key: &'life1 [u8],
payload: Vec<u8>,
session_id: Option<SessionId>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a binary message to a peer via the relay service.
Source§fn new_meeting<'life0, 'async_trait>(
&'life0 mut self,
owner_id: UserId,
slots: HashSet<UserId>,
data: Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn new_meeting<'life0, 'async_trait>(
&'life0 mut self,
owner_id: UserId,
slots: HashSet<UserId>,
data: Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new meeting point.
Source§fn join_meeting<'life0, 'async_trait>(
&'life0 mut self,
meeting_id: MeetingId,
user_id: UserId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn join_meeting<'life0, 'async_trait>(
&'life0 mut self,
meeting_id: MeetingId,
user_id: UserId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Join a meeting point.
Source§fn new_session<'life0, 'async_trait>(
&'life0 mut self,
participant_keys: Vec<Vec<u8>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn new_session<'life0, 'async_trait>(
&'life0 mut self,
participant_keys: Vec<Vec<u8>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new session.
Source§fn register_connection<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
session_id: &'life1 SessionId,
peer_key: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn register_connection<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
session_id: &'life1 SessionId,
peer_key: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Register a peer connection in a session.
Source§fn close_session<'life0, 'async_trait>(
&'life0 mut self,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close_session<'life0, 'async_trait>(
&'life0 mut self,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Close a session.
Auto Trait Implementations§
impl Freeze for NativeClient
impl !RefUnwindSafe for NativeClient
impl Send for NativeClient
impl Sync for NativeClient
impl Unpin for NativeClient
impl !UnwindSafe for NativeClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more