[−][src]Struct stunclient::StunClient
Options for querying STUN server
Fields
timeout: Duration
"End-to-end" timeout for the operation.
retry_interval: Duration
How often to repeat STUN binding requests
stun_server: SocketAddr
Address of the STUN server
software: Option<&'static str>
SOFTWARE
attribute value in binding request
Methods
impl StunClient
[src]
pub fn new(stun_server: SocketAddr) -> Self
[src]
A constructor with default parameters
pub fn with_google_stun_server() -> Self
[src]
Use hard coded STUN server stun.l.google.com:19302
.
Not for production use, for tests, prototypes and demos. May block the thread. May panic if case of address resolution problems.
pub fn set_timeout(&mut self, timeout: Duration) -> &mut Self
[src]
Set timeout
field, builder pattern.
pub fn set_retry_interval(&mut self, retry_interval: Duration) -> &mut Self
[src]
Set retry_interval
field, builder pattern.
pub fn set_software(&mut self, software: Option<&'static str>) -> &mut Self
[src]
Set software
field, builder pattern.
impl StunClient
[src]
pub fn query_external_address(
&self,
udp: &UdpSocket
) -> Result<SocketAddr, Error>
[src]
&self,
udp: &UdpSocket
) -> Result<SocketAddr, Error>
Get external (server-reflexive transport address) IP address and port of specified UDP socket
pub fn query_external_address_async(
self,
udp: UdpSocket
) -> impl Future<Item = (UdpSocket, SocketAddr), Error = Error>
[src]
self,
udp: UdpSocket
) -> impl Future<Item = (UdpSocket, SocketAddr), Error = Error>
async version of query_external_address
.
Requires async
crate feature to be enabled (it is by default)
Auto Trait Implementations
impl Send for StunClient
impl Sync for StunClient
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,