Struct stun_client::Client
source · pub struct Client { /* private fields */ }
Expand description
STUN client. The transport protocol is UDP only and only supports simple STUN Binding requests.
Implementations§
source§impl Client
impl Client
sourcepub async fn new<A: ToSocketAddrs>(
local_bind_addr: A,
opts: Option<Options>
) -> Result<Client, STUNClientError>
pub async fn new<A: ToSocketAddrs>( local_bind_addr: A, opts: Option<Options> ) -> Result<Client, STUNClientError>
Create a Client.
sourcepub fn from_socket(socket: Arc<UdpSocket>, opts: Option<Options>) -> Client
pub fn from_socket(socket: Arc<UdpSocket>, opts: Option<Options>) -> Client
Create a Client from async_std::net::UdpSocket.
sourcepub async fn binding_request<A: ToSocketAddrs>(
&mut self,
stun_addr: A,
attrs: Option<HashMap<Attribute, Vec<u8>>>
) -> Result<Message, STUNClientError>
pub async fn binding_request<A: ToSocketAddrs>( &mut self, stun_addr: A, attrs: Option<HashMap<Attribute, Vec<u8>>> ) -> Result<Message, STUNClientError>
Send STUN Binding request asynchronously.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more