pub struct RiftHandle { /* private fields */ }Expand description
Primary SDK handle exposed to callers.
Implementations§
Source§impl RiftHandle
impl RiftHandle
Sourcepub async fn new(config: RiftConfig) -> Result<Self, RiftError>
pub async fn new(config: RiftConfig) -> Result<Self, RiftError>
Initialize the SDK runtime with the given config and identity.
Sourcepub async fn set_dht_enabled(&self, enabled: bool)
pub async fn set_dht_enabled(&self, enabled: bool)
Enable or disable DHT discovery for subsequent joins.
Sourcepub async fn set_bootstrap_nodes(&self, nodes: Vec<String>)
pub async fn set_bootstrap_nodes(&self, nodes: Vec<String>)
Override DHT bootstrap nodes.
Sourcepub async fn set_invite(&self, invite: Option<String>)
pub async fn set_invite(&self, invite: Option<String>)
Provide an invite link override for joining.
Sourcepub async fn set_turn_servers(&self, servers: Vec<String>)
pub async fn set_turn_servers(&self, servers: Vec<String>)
Configure TURN servers for relay fallback.
Sourcepub async fn set_audio_quality(&self, quality: Option<String>)
pub async fn set_audio_quality(&self, quality: Option<String>)
Override the audio quality preset.
Sourcepub async fn join_channel(
&self,
name: &str,
password: Option<&str>,
internet: bool,
) -> Result<(), RiftError>
pub async fn join_channel( &self, name: &str, password: Option<&str>, internet: bool, ) -> Result<(), RiftError>
Join a channel by name/password, optionally using internet mode.
Sourcepub async fn leave_channel(&self, _name: &str) -> Result<(), RiftError>
pub async fn leave_channel(&self, _name: &str) -> Result<(), RiftError>
Leave the currently joined channel and tear down runtime state.
Sourcepub async fn send_chat(&self, text: &str) -> Result<(), RiftError>
pub async fn send_chat(&self, text: &str) -> Result<(), RiftError>
Send a chat message to all peers.
Sourcepub async fn start_call(&self, peer: PeerId) -> Result<SessionId, RiftError>
pub async fn start_call(&self, peer: PeerId) -> Result<SessionId, RiftError>
Start a call with a specific peer.
Sourcepub async fn start_call_with_srt(
&self,
peer: PeerId,
rndzv_srt_uri: Option<String>,
) -> Result<SessionId, RiftError>
pub async fn start_call_with_srt( &self, peer: PeerId, rndzv_srt_uri: Option<String>, ) -> Result<SessionId, RiftError>
Start a call with an optional rndzv SRT URI attached to the invite.
Sourcepub async fn accept_call(&self, session: SessionId) -> Result<(), RiftError>
pub async fn accept_call(&self, session: SessionId) -> Result<(), RiftError>
Accept an incoming call.
Sourcepub async fn decline_call(
&self,
session: SessionId,
reason: Option<&str>,
) -> Result<(), RiftError>
pub async fn decline_call( &self, session: SessionId, reason: Option<&str>, ) -> Result<(), RiftError>
Decline an incoming call with optional reason.
Sourcepub async fn end_call(&self, session: SessionId) -> Result<(), RiftError>
pub async fn end_call(&self, session: SessionId) -> Result<(), RiftError>
End an active call session.
Sourcepub async fn next_event(&self) -> Option<RiftEvent>
pub async fn next_event(&self) -> Option<RiftEvent>
Await the next event from the SDK.
Sourcepub fn try_next_event(&self) -> Option<RiftEvent>
pub fn try_next_event(&self) -> Option<RiftEvent>
Try to fetch the next event without awaiting.
Sourcepub fn set_ptt_active(&self, active: bool)
pub fn set_ptt_active(&self, active: bool)
Set push-to-talk active state.
Sourcepub fn local_peer_id(&self) -> PeerId
pub fn local_peer_id(&self) -> PeerId
Return the local peer id.
Auto Trait Implementations§
impl !Freeze for RiftHandle
impl !RefUnwindSafe for RiftHandle
impl !Send for RiftHandle
impl !Sync for RiftHandle
impl Unpin for RiftHandle
impl !UnwindSafe for RiftHandle
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
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more