Struct medea_coturn_telnet_client::CoturnTelnetConnection [−][src]
Implementations
impl CoturnTelnetConnection
[src]
pub async fn connect<A: ToSocketAddrs, B: Into<Bytes>>(
addr: A,
pass: B
) -> Result<CoturnTelnetConnection, CoturnTelnetError>
[src]
addr: A,
pass: B
) -> Result<CoturnTelnetConnection, CoturnTelnetError>
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]
&mut self,
username: String
) -> Result<Vec<String>, CoturnTelnetError>
Returns session IDs for Coturn server associated with the provided
username
.
- Sends
CoturnCliRequest::PrintSessions
with the providedusername
. - 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]
&mut self,
session_id: String
) -> Result<(), CoturnTelnetError>
Closes session on Coturn server destroying this session’s allocations and channels.
- Sends
CoturnCliRequest::CloseSession
with the providedsession_id
. - 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]
&mut self,
session_ids: T
) -> Result<(), CoturnTelnetError>
Closes multiple sessions on Coturn server destroying their allocations and channels.
For each provided session id:
- Sends
CoturnCliRequest::CloseSession
with specified session id. - 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
- Unable to send message to remote server.
- Transport error while waiting for server response.
- First message received is not
CoturnCliResponse::UnknownCommand
.
Trait Implementations
impl Debug for CoturnTelnetConnection
[src]
impl Manager<CoturnTelnetConnection, CoturnTelnetError> for Manager
[src]
This is supported on crate feature
pool
only.fn create<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<CoturnTelnetConnection, CoturnTelnetError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<CoturnTelnetConnection, CoturnTelnetError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn recycle<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut CoturnTelnetConnection
) -> Pin<Box<dyn Future<Output = RecycleResult<CoturnTelnetError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
conn: &'life1 mut CoturnTelnetConnection
) -> Pin<Box<dyn Future<Output = RecycleResult<CoturnTelnetError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations
impl !RefUnwindSafe for CoturnTelnetConnection
impl Send for CoturnTelnetConnection
impl Sync for CoturnTelnetConnection
impl Unpin for CoturnTelnetConnection
impl !UnwindSafe for CoturnTelnetConnection
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,