Skip to main content

RiftHandle

Struct RiftHandle 

Source
pub struct RiftHandle { /* private fields */ }
Expand description

Primary SDK handle exposed to callers.

Implementations§

Source§

impl RiftHandle

Source

pub async fn new(config: RiftConfig) -> Result<Self, RiftError>

Initialize the SDK runtime with the given config and identity.

Source

pub async fn set_dht_enabled(&self, enabled: bool)

Enable or disable DHT discovery for subsequent joins.

Source

pub async fn set_bootstrap_nodes(&self, nodes: Vec<String>)

Override DHT bootstrap nodes.

Source

pub async fn set_invite(&self, invite: Option<String>)

Provide an invite link override for joining.

Source

pub async fn set_turn_servers(&self, servers: Vec<String>)

Configure TURN servers for relay fallback.

Source

pub async fn set_audio_quality(&self, quality: Option<String>)

Override the audio quality preset.

Source

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.

Source

pub async fn leave_channel(&self, _name: &str) -> Result<(), RiftError>

Leave the currently joined channel and tear down runtime state.

Source

pub async fn send_chat(&self, text: &str) -> Result<(), RiftError>

Send a chat message to all peers.

Source

pub async fn start_call(&self, peer: PeerId) -> Result<SessionId, RiftError>

Start a call with a specific peer.

Source

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.

Source

pub async fn accept_call(&self, session: SessionId) -> Result<(), RiftError>

Accept an incoming call.

Source

pub async fn decline_call( &self, session: SessionId, reason: Option<&str>, ) -> Result<(), RiftError>

Decline an incoming call with optional reason.

Source

pub async fn end_call(&self, session: SessionId) -> Result<(), RiftError>

End an active call session.

Source

pub async fn next_event(&self) -> Option<RiftEvent>

Await the next event from the SDK.

Source

pub fn try_next_event(&self) -> Option<RiftEvent>

Try to fetch the next event without awaiting.

Source

pub fn set_ptt_active(&self, active: bool)

Set push-to-talk active state.

Source

pub fn set_mute(&self, muted: bool)

Mute or unmute microphone capture.

Source

pub fn local_peer_id(&self) -> PeerId

Return the local peer id.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,