pub enum TurnClient {
Udp(TurnClientUdp),
Tcp(TurnClientTcp),
}Expand description
A TURN client.
Variants§
Trait Implementations§
Source§impl Debug for TurnClient
impl Debug for TurnClient
Source§impl From<TurnClientTcp> for TurnClient
impl From<TurnClientTcp> for TurnClient
Source§fn from(value: TurnClientTcp) -> Self
fn from(value: TurnClientTcp) -> Self
Converts to this type from the input type.
Source§impl From<TurnClientUdp> for TurnClient
impl From<TurnClientUdp> for TurnClient
Source§fn from(value: TurnClientUdp) -> Self
fn from(value: TurnClientUdp) -> Self
Converts to this type from the input type.
Source§impl TurnClientApi for TurnClient
impl TurnClientApi for TurnClient
Source§fn transport(&self) -> TransportType
fn transport(&self) -> TransportType
The transport of the connection to the TURN server.
Source§fn local_addr(&self) -> SocketAddr
fn local_addr(&self) -> SocketAddr
The local address of this TURN client.
Source§fn remote_addr(&self) -> SocketAddr
fn remote_addr(&self) -> SocketAddr
The remote TURN server’s address.
Source§fn relayed_addresses(
&self,
) -> impl Iterator<Item = (TransportType, SocketAddr)> + '_
fn relayed_addresses( &self, ) -> impl Iterator<Item = (TransportType, SocketAddr)> + '_
The list of allocated relayed addresses on the TURN server.
Source§fn permissions(
&self,
transport: TransportType,
relayed: SocketAddr,
) -> impl Iterator<Item = IpAddr> + '_
fn permissions( &self, transport: TransportType, relayed: SocketAddr, ) -> impl Iterator<Item = IpAddr> + '_
The list of permissions available for the provided relayed address.
Source§fn delete(&mut self, now: Instant) -> Result<(), DeleteError>
fn delete(&mut self, now: Instant) -> Result<(), DeleteError>
Remove the allocation/s on the server.
Source§fn create_permission(
&mut self,
transport: TransportType,
peer_addr: IpAddr,
now: Instant,
) -> Result<(), CreatePermissionError>
fn create_permission( &mut self, transport: TransportType, peer_addr: IpAddr, now: Instant, ) -> Result<(), CreatePermissionError>
Create a permission address to allow sending/receiving data to/from.
Source§fn have_permission(&self, transport: TransportType, to: IpAddr) -> bool
fn have_permission(&self, transport: TransportType, to: IpAddr) -> bool
Whether the client currently has a permission installed for the provided transport and
address.
Source§fn bind_channel(
&mut self,
transport: TransportType,
peer_addr: SocketAddr,
now: Instant,
) -> Result<(), BindChannelError>
fn bind_channel( &mut self, transport: TransportType, peer_addr: SocketAddr, now: Instant, ) -> Result<(), BindChannelError>
Bind a channel for sending/receiving data to/from a particular peer.
Source§fn tcp_connect(
&mut self,
peer_addr: SocketAddr,
now: Instant,
) -> Result<(), TcpConnectError>
fn tcp_connect( &mut self, peer_addr: SocketAddr, now: Instant, ) -> Result<(), TcpConnectError>
Attempt to connect to a peer from the TURN server using TCP. Read more
Source§fn allocated_tcp_socket(
&mut self,
id: u32,
five_tuple: Socket5Tuple,
peer_addr: SocketAddr,
local_addr: Option<SocketAddr>,
now: Instant,
) -> Result<(), TcpAllocateError>
fn allocated_tcp_socket( &mut self, id: u32, five_tuple: Socket5Tuple, peer_addr: SocketAddr, local_addr: Option<SocketAddr>, now: Instant, ) -> Result<(), TcpAllocateError>
Indicate success (or failure) to create a socket for the specified server and peer address. Read more
Source§fn tcp_closed(
&mut self,
local_addr: SocketAddr,
remote_addr: SocketAddr,
now: Instant,
)
fn tcp_closed( &mut self, local_addr: SocketAddr, remote_addr: SocketAddr, now: Instant, )
Indicate that the TCP connection has been closed.
Source§fn send_to<T: AsRef<[u8]> + Debug>(
&mut self,
transport: TransportType,
to: SocketAddr,
data: T,
now: Instant,
) -> Result<Option<TransmitBuild<DelayedMessageOrChannelSend<T>>>, SendError>
fn send_to<T: AsRef<[u8]> + Debug>( &mut self, transport: TransportType, to: SocketAddr, data: T, now: Instant, ) -> Result<Option<TransmitBuild<DelayedMessageOrChannelSend<T>>>, SendError>
Send data to a peer through the TURN server. Read more
Source§fn recv<T: AsRef<[u8]> + Debug>(
&mut self,
transmit: Transmit<T>,
now: Instant,
) -> TurnRecvRet<T>
fn recv<T: AsRef<[u8]> + Debug>( &mut self, transmit: Transmit<T>, now: Instant, ) -> TurnRecvRet<T>
Provide received data to the TURN client for handling. Read more
Source§fn poll_recv(&mut self, now: Instant) -> Option<TurnPeerData<Vec<u8>>>
fn poll_recv(&mut self, now: Instant) -> Option<TurnPeerData<Vec<u8>>>
Poll the client for any further received data.
Source§fn poll(&mut self, now: Instant) -> TurnPollRet
fn poll(&mut self, now: Instant) -> TurnPollRet
Poll the client for further progress.
Source§fn poll_transmit(&mut self, now: Instant) -> Option<Transmit<Data<'static>>>
fn poll_transmit(&mut self, now: Instant) -> Option<Transmit<Data<'static>>>
Poll for a packet to send.
Source§fn poll_event(&mut self) -> Option<TurnEvent>
fn poll_event(&mut self) -> Option<TurnEvent>
Poll for an event that has occurred.
Source§fn protocol_error(&mut self)
fn protocol_error(&mut self)
A higher layer has encountered an error and this client is no longer usable.
Auto Trait Implementations§
impl Freeze for TurnClient
impl RefUnwindSafe for TurnClient
impl Send for TurnClient
impl Sync for TurnClient
impl Unpin for TurnClient
impl UnsafeUnpin for TurnClient
impl UnwindSafe for TurnClient
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