Struct medea_coturn_telnet_client::CoturnTelnetConnection[][src]

pub struct CoturnTelnetConnection(_);

Asynchronous connection to remote Coturn server via Telnet interface.

Implementations

impl CoturnTelnetConnection[src]

pub async fn connect<A: ToSocketAddrs, B: Into<Bytes>>(
    addr: A,
    pass: B
) -> Result<CoturnTelnetConnection, CoturnTelnetError>
[src]

Opens a Telnet connection to a remote host using a TcpStream and performs authentication.

Errors

Errors if couldn’t open TcpStream or authentication failed.

pub async fn print_sessions(
    &mut self,
    username: String
) -> Result<Vec<String>, CoturnTelnetError>
[src]

Returns session IDs for Coturn server associated with the provided username.

  1. Sends CoturnCliRequest::PrintSessions with the provided username.
  2. Awaits for CoturnCliResponse::Sessions.

Errors

  • Unable to send message to remote server.
  • Transport error while waiting for server response.
  • Received an unexpected (not CoturnCliResponse::Sessions) response from remote server.

pub async fn delete_session(
    &mut self,
    session_id: String
) -> Result<(), CoturnTelnetError>
[src]

Closes session on Coturn server destroying this session’s allocations and channels.

  1. Sends CoturnCliRequest::CloseSession with the provided session_id.
  2. Awaits for CoturnCliResponse::Ready.

Errors

  • Unable to send message to remote server.
  • Transport error while waiting for server response.
  • Received an unexpected (not CoturnCliResponse::Ready) response from remote server.

pub async fn delete_sessions<T: IntoIterator<Item = String>>(
    &mut self,
    session_ids: T
) -> Result<(), CoturnTelnetError>
[src]

Closes multiple sessions on Coturn server destroying their allocations and channels.

For each provided session id:

  1. Sends CoturnCliRequest::CloseSession with specified session id.
  2. Awaits for CoturnCliResponse::Ready.

Errors

  • Unable to send message to remote server.
  • Transport error while waiting for server response.
  • Received an unexpected (not CoturnCliResponse::Sessions) response from remote server.

pub async fn ping(&mut self) -> Result<(), CoturnTelnetError>[src]

Pings Coturn server via Telnet.

Errors

Trait Implementations

impl Debug for CoturnTelnetConnection[src]

impl Manager<CoturnTelnetConnection, CoturnTelnetError> for Manager[src]

This is supported on crate feature pool only.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.