Struct saltyrtc_client::SaltyClientBuilder
source · [−]pub struct SaltyClientBuilder { /* private fields */ }
Expand description
The builder instance returned by
SaltyClient::build
. Use this
builder to construct a SaltyClient
instance.
Implementations
sourceimpl SaltyClientBuilder
impl SaltyClientBuilder
sourcepub fn add_task(self, task: BoxedTask) -> Self
pub fn add_task(self, task: BoxedTask) -> Self
Register a Task
that should be accepted by the client.
When calling this method multiple times, tasks added first have the highest priority during task negotation.
sourcepub fn with_server_key(self, server_public_permanent_key: PublicKey) -> Self
pub fn with_server_key(self, server_public_permanent_key: PublicKey) -> Self
Specify the server public permanent key if you want to use server key pinning.
sourcepub fn with_ping_interval(self, interval: Option<Duration>) -> Self
pub fn with_ping_interval(self, interval: Option<Duration>) -> Self
Request that the server sends a WebSocket ping message at the specified interval.
Set the interval
argument to None
or to a zero duration to disable intervals.
Note: Fractions of seconds are ignored, so if you set the duration to 13.37s, then the ping interval 13s will be requested.
By default, ping messages are disabled.
sourcepub fn initiator(self) -> Result<SaltyClient, BuilderError>
pub fn initiator(self) -> Result<SaltyClient, BuilderError>
Create a new SaltyRTC initiator.
sourcepub fn initiator_trusted(
self,
responder_trusted_pubkey: PublicKey
) -> Result<SaltyClient, BuilderError>
pub fn initiator_trusted(
self,
responder_trusted_pubkey: PublicKey
) -> Result<SaltyClient, BuilderError>
Create a new SaltyRTC initiator with a trusted peer public key.
sourcepub fn responder(
self,
initiator_pubkey: PublicKey,
auth_token: AuthToken
) -> Result<SaltyClient, BuilderError>
pub fn responder(
self,
initiator_pubkey: PublicKey,
auth_token: AuthToken
) -> Result<SaltyClient, BuilderError>
Create a new SaltyRTC responder.
sourcepub fn responder_trusted(
self,
initiator_trusted_pubkey: PublicKey
) -> Result<SaltyClient, BuilderError>
pub fn responder_trusted(
self,
initiator_trusted_pubkey: PublicKey
) -> Result<SaltyClient, BuilderError>
Create a new SaltyRTC responder with a trusted peer public key.