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,
) -> Self
pub fn new( client_transport: TransportType, turn_server: Address, credentials: TurnCredentials, ) -> 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(),
);
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 set_tls_config(&mut self, tls_config: TurnTlsConfig)
pub fn set_tls_config(&mut self, tls_config: 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 set_allocation_transport(&mut self, allocation_transport: TransportType)
pub fn set_allocation_transport(&mut self, allocation_transport: TransportType)
Set the allocation transport requested from the TURN server.
Sourcepub fn allocation_transport(&self) -> TransportType
pub fn allocation_transport(&self) -> TransportType
Retrieve the allocation transport requested.
Sourcepub fn add_address_family(&mut self, family: AddressFamily)
pub fn add_address_family(&mut self, family: AddressFamily)
Add an AddressFamily that will be requested.
Duplicate AddressFamilys are ignored.
Sourcepub fn set_address_family(&mut self, family: AddressFamily)
pub fn set_address_family(&mut self, family: AddressFamily)
Set the AddressFamily that will be requested.
This will override all previously set AddressFamilys.
Sourcepub fn address_families(&self) -> Vec<AddressFamily>
pub fn address_families(&self) -> Vec<AddressFamily>
Retrieve the AddressFamilys that are requested.
Sourcepub fn credentials(&self) -> TurnCredentials
pub fn credentials(&self) -> TurnCredentials
The credentials for accessing the TURN server.
Sourcepub fn add_supported_integrity(&mut self, integrity: IntegrityAlgorithm)
pub fn add_supported_integrity(&mut self, integrity: IntegrityAlgorithm)
Add a supported integrity algorithm that could be used.
Sourcepub fn set_supported_integrity(&mut self, integrity: IntegrityAlgorithm)
pub fn set_supported_integrity(&mut self, integrity: IntegrityAlgorithm)
Set the supported integrity algorithm used.
Sourcepub fn supported_integrity(&self) -> Vec<IntegrityAlgorithm>
pub fn supported_integrity(&self) -> Vec<IntegrityAlgorithm>
The supported integrity algorithms used.
Sourcepub fn set_anonymous_username(&mut self, anon: Feature)
pub fn set_anonymous_username(&mut self, anon: Feature)
Set whether anonymous username usage is required.
A value of Required requires the server to support RFC 8489 and the Userhash attribute.
Sourcepub fn anonymous_username(&self) -> Feature
pub fn anonymous_username(&self) -> Feature
Whether anonymous username usage is required.
A value of Required requires the server to support RFC 8489 and the Userhash attribute.