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 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
Trait Implementations§
Source§impl Protocol<TransportMessage<BytesMut>, TransportMessage<BytesMut>, ()> for Client
impl Protocol<TransportMessage<BytesMut>, TransportMessage<BytesMut>, ()> for Client
Source§fn handle_read(&mut self, msg: TaggedBytesMut) -> Result<(), Self::Error>
fn handle_read(&mut self, msg: TaggedBytesMut) -> Result<(), Self::Error>
Handle an incoming read message. Read more
Source§fn handle_write(&mut self, _msg: TaggedBytesMut) -> Result<(), Self::Error>
fn handle_write(&mut self, _msg: TaggedBytesMut) -> Result<(), Self::Error>
Handle an outgoing write message. Read more
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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