pub struct TurnConfig { /* private fields */ }Expand description
Configuration for a particular TURN server connection.
Implementations§
Source§impl TurnConfig
impl TurnConfig
Sourcepub fn new(
client_transport: TransportType,
turn_server: Address,
credentials: TurnCredentials,
families: &[AddressFamily],
tls_config: Option<TurnTlsConfig>,
) -> Self
pub fn new( client_transport: TransportType, turn_server: Address, credentials: TurnCredentials, families: &[AddressFamily], tls_config: Option<TurnTlsConfig>, ) -> Self
Create a new TurnConfig from the provided details.
§Examples
let credentials = TurnCredentials::new("user", "pass");
let server_addr = rice_c::Address::from("127.0.0.1:3478".parse::<SocketAddr>().unwrap());
let config = TurnConfig::new(
TransportType::Udp,
server_addr.clone(),
credentials.clone(),
&[AddressFamily::IPV4],
None,
);
assert_eq!(config.client_transport(), TransportType::Udp);
assert_eq!(config.addr(), server_addr);
// FIXME
//assert_eq!(config.credentials().username(), credentials.username());Sourcepub fn tls_config(&self) -> Option<TurnTlsConfig>
pub fn tls_config(&self) -> Option<TurnTlsConfig>
The TLS configuration to use for connecting to this TURN server.
Sourcepub fn client_transport(&self) -> TransportType
pub fn client_transport(&self) -> TransportType
The TransportType between the client and the TURN server.
Sourcepub fn credentials(&self) -> TurnCredentials
pub fn credentials(&self) -> TurnCredentials
The credentials for accessing the TURN server.
Trait Implementations§
Source§impl Clone for TurnConfig
impl Clone for TurnConfig
Source§impl Debug for TurnConfig
impl Debug for TurnConfig
Source§impl Drop for TurnConfig
impl Drop for TurnConfig
impl Send for TurnConfig
Auto Trait Implementations§
impl Freeze for TurnConfig
impl RefUnwindSafe for TurnConfig
impl !Sync for TurnConfig
impl Unpin for TurnConfig
impl UnwindSafe for TurnConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)