Skip to main content

LocalParticipant

Struct LocalParticipant 

Source
pub struct LocalParticipant { /* private fields */ }

Implementations§

Source§

impl LocalParticipant

Source

pub async fn publish_track( &self, track: LocalTrack, options: TrackPublishOptions, ) -> RoomResult<LocalTrackPublication>

Source

pub async fn set_metadata(&self, metadata: String) -> RoomResult<()>

Source

pub async fn set_attributes( &self, attributes: HashMap<String, String>, ) -> RoomResult<()>

Source

pub async fn set_name(&self, name: String) -> RoomResult<()>

Source

pub async fn send_chat_message( &self, text: String, destination_identities: Option<Vec<String>>, sender_identity: Option<String>, ) -> RoomResult<ChatMessage>

Source

pub async fn edit_chat_message( &self, edit_text: String, original_message: ChatMessage, destination_identities: Option<Vec<String>>, sender_identity: Option<String>, ) -> RoomResult<ChatMessage>

Source

pub async fn unpublish_track( &self, sid: &TrackSid, ) -> RoomResult<LocalTrackPublication>

Source

pub async fn publish_raw_data( self, packet: DataPacket, reliable: bool, ) -> RoomResult<()>

internal

Source

pub async fn publish_data(&self, packet: DataPacket) -> RoomResult<()>

Source

pub fn set_data_channel_buffered_amount_low_threshold( &self, threshold: u64, kind: DataPacketKind, ) -> RoomResult<()>

Source

pub fn data_channel_buffered_amount_low_threshold( &self, kind: DataPacketKind, ) -> RoomResult<u64>

Source

pub async fn set_track_subscription_permissions( &self, all_participants_allowed: bool, permissions: Vec<ParticipantTrackPermission>, ) -> RoomResult<()>

Source

pub async fn publish_transcription( &self, packet: Transcription, ) -> RoomResult<()>

Source

pub async fn publish_dtmf(&self, dtmf: SipDTMF) -> RoomResult<()>

Source

pub fn get_track_publication( &self, sid: &TrackSid, ) -> Option<LocalTrackPublication>

Source

pub fn sid(&self) -> ParticipantSid

Source

pub fn identity(&self) -> ParticipantIdentity

Source

pub fn name(&self) -> String

Source

pub fn metadata(&self) -> String

Source

pub fn attributes(&self) -> HashMap<String, String>

Source

pub fn is_speaking(&self) -> bool

Source

pub fn track_publications(&self) -> HashMap<TrackSid, LocalTrackPublication>

Source

pub fn audio_level(&self) -> f32

Source

pub fn connection_quality(&self) -> ConnectionQuality

Source

pub fn kind(&self) -> ParticipantKind

Source

pub fn kind_details(&self) -> Vec<ParticipantKindDetail>

Source

pub fn disconnect_reason(&self) -> DisconnectReason

Source

pub fn permission(&self) -> Option<ParticipantPermission>

Source

pub async fn perform_rpc( &self, data: PerformRpcData, ) -> Result<String, RpcError>

Source

pub fn register_rpc_method( &self, method: String, handler: impl Fn(RpcInvocationData) -> Pin<Box<dyn Future<Output = Result<String, RpcError>> + Send>> + Send + Sync + 'static, )

Source

pub fn unregister_rpc_method(&self, method: String)

Source

pub async fn send_text( &self, text: &str, options: StreamTextOptions, ) -> StreamResult<TextStreamInfo>

Send text to participants in the room.

This method sends a complete text string to participants in the room as a text stream. The text is sent in a single operation, and the method returns information about the stream used to send the text.

§Arguments
  • text - The text content to send.
  • options - Configuration options for the text stream, including topic and destination participants.
Source

pub async fn send_file( &self, path: impl AsRef<Path>, options: StreamByteOptions, ) -> StreamResult<ByteStreamInfo>

Send a file on disk to participants in the room.

This method reads a file from the specified path and sends its contents to participants in the room as a byte stream, and the method returns information the stream used to send the file.

§Arguments
  • path - Path to the file to be sent.
  • options - Configuration options for the byte stream, including topic and destination participants.
Source

pub async fn send_bytes( &self, data: impl AsRef<[u8]>, options: StreamByteOptions, ) -> StreamResult<ByteStreamInfo>

Send an in-memory blob of bytes to participants in the room.

This method sends a provided byte slice as a byte stream.

§Arguments
  • data - The bytes to send.
  • options - Configuration options for the byte stream, including topic and destination participants.
Source

pub async fn stream_text( &self, options: StreamTextOptions, ) -> StreamResult<TextStreamWriter>

Stream text incrementally to participants in the room.

This method allows sending text data in chunks as it becomes available. Unlike send_text, which sends the entire text at once, this method returns a writer that can be used to send text incrementally.

§Arguments
  • options - Configuration options for the text stream, including topic and destination participants.
Source

pub async fn stream_bytes( &self, options: StreamByteOptions, ) -> StreamResult<ByteStreamWriter>

Stream bytes incrementally to participants in the room.

This method allows sending binary data in chunks as it becomes available. Unlike send_file, which sends the entire file at once, this method returns a writer that can be used to send binary data incrementally.

§Arguments
  • options - Configuration options for the byte stream, including topic and destination participants.
Source

pub fn is_encrypted(&self) -> bool

Trait Implementations§

Source§

impl Clone for LocalParticipant

Source§

fn clone(&self) -> LocalParticipant

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LocalParticipant

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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