pub struct LocalParticipant { /* private fields */ }Implementations§
Source§impl LocalParticipant
impl LocalParticipant
pub async fn publish_track( &self, track: LocalTrack, options: TrackPublishOptions, ) -> RoomResult<LocalTrackPublication>
pub async fn set_metadata(&self, metadata: String) -> RoomResult<()>
pub async fn set_attributes( &self, attributes: HashMap<String, String>, ) -> RoomResult<()>
pub async fn set_name(&self, name: String) -> RoomResult<()>
pub async fn send_chat_message( &self, text: String, destination_identities: Option<Vec<String>>, sender_identity: Option<String>, ) -> RoomResult<ChatMessage>
pub async fn edit_chat_message( &self, edit_text: String, original_message: ChatMessage, destination_identities: Option<Vec<String>>, sender_identity: Option<String>, ) -> RoomResult<ChatMessage>
pub async fn unpublish_track( &self, sid: &TrackSid, ) -> RoomResult<LocalTrackPublication>
Sourcepub async fn publish_raw_data(
self,
packet: DataPacket,
reliable: bool,
) -> RoomResult<()>
pub async fn publish_raw_data( self, packet: DataPacket, reliable: bool, ) -> RoomResult<()>
internal
pub async fn publish_data(&self, packet: DataPacket) -> RoomResult<()>
pub fn set_data_channel_buffered_amount_low_threshold( &self, threshold: u64, kind: DataPacketKind, ) -> RoomResult<()>
pub fn data_channel_buffered_amount_low_threshold( &self, kind: DataPacketKind, ) -> RoomResult<u64>
pub async fn set_track_subscription_permissions( &self, all_participants_allowed: bool, permissions: Vec<ParticipantTrackPermission>, ) -> RoomResult<()>
pub async fn publish_transcription( &self, packet: Transcription, ) -> RoomResult<()>
pub async fn publish_dtmf(&self, dtmf: SipDTMF) -> RoomResult<()>
pub fn get_track_publication( &self, sid: &TrackSid, ) -> Option<LocalTrackPublication>
pub fn sid(&self) -> ParticipantSid
pub fn identity(&self) -> ParticipantIdentity
pub fn name(&self) -> String
pub fn metadata(&self) -> String
pub fn attributes(&self) -> HashMap<String, String>
pub fn is_speaking(&self) -> bool
pub fn track_publications(&self) -> HashMap<TrackSid, LocalTrackPublication>
pub fn audio_level(&self) -> f32
pub fn connection_quality(&self) -> ConnectionQuality
pub fn kind(&self) -> ParticipantKind
pub fn kind_details(&self) -> Vec<ParticipantKindDetail>
pub fn disconnect_reason(&self) -> DisconnectReason
pub fn permission(&self) -> Option<ParticipantPermission>
pub async fn perform_rpc( &self, data: PerformRpcData, ) -> Result<String, RpcError>
pub fn register_rpc_method( &self, method: String, handler: impl Fn(RpcInvocationData) -> Pin<Box<dyn Future<Output = Result<String, RpcError>> + Send>> + Send + Sync + 'static, )
pub fn unregister_rpc_method(&self, method: String)
Sourcepub async fn send_text(
&self,
text: &str,
options: StreamTextOptions,
) -> StreamResult<TextStreamInfo>
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.
Sourcepub async fn send_file(
&self,
path: impl AsRef<Path>,
options: StreamByteOptions,
) -> StreamResult<ByteStreamInfo>
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.
Sourcepub async fn send_bytes(
&self,
data: impl AsRef<[u8]>,
options: StreamByteOptions,
) -> StreamResult<ByteStreamInfo>
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.
Sourcepub async fn stream_text(
&self,
options: StreamTextOptions,
) -> StreamResult<TextStreamWriter>
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.
Sourcepub async fn stream_bytes(
&self,
options: StreamByteOptions,
) -> StreamResult<ByteStreamWriter>
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.
pub fn is_encrypted(&self) -> bool
Trait Implementations§
Source§impl Clone for LocalParticipant
impl Clone for LocalParticipant
Source§fn clone(&self) -> LocalParticipant
fn clone(&self) -> LocalParticipant
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more