pub struct Client { /* private fields */ }
Expand description
Client is a STUN client
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(config: ClientConfig) -> Result<Self>
pub fn new(config: ClientConfig) -> Result<Self>
new returns a new Client instance. listeningAddress is the address and port to listen on, default “0.0.0.0:0”
pub fn poll_timout(&mut self) -> Option<Instant>
pub fn handle_timeout(&mut self, now: Instant)
pub fn poll_transmit(&mut self) -> Option<Transmit<BytesMut>>
pub fn handle_transmit(&mut self, msg: Transmit<BytesMut>) -> Result<()>
pub fn poll_event(&mut self) -> Option<Event>
pub fn relay(&mut self, relayed_addr: SocketAddr) -> Result<Relay<'_>>
Sourcepub fn send_binding_request_to(
&mut self,
to: SocketAddr,
) -> Result<TransactionId>
pub fn send_binding_request_to( &mut self, to: SocketAddr, ) -> Result<TransactionId>
send_binding_request_to sends a new STUN request to the given transport address return key to find out corresponding Event either BindingResponse or BindingRequestTimeout
Sourcepub fn send_binding_request(&mut self) -> Result<TransactionId>
pub fn send_binding_request(&mut self) -> Result<TransactionId>
send_binding_request sends a new STUN request to the STUN server return key to find out corresponding Event either BindingResponse or BindingRequestTimeout
Sourcepub fn allocate(&mut self) -> Result<TransactionId>
pub fn allocate(&mut self) -> Result<TransactionId>
Allocate sends a TURN allocation request to the given transport address
Auto Trait Implementations§
impl Freeze for Client
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