Skip to main content

TurnClientDimpl

Struct TurnClientDimpl 

Source
pub struct TurnClientDimpl { /* private fields */ }
Expand description

A TURN client that communicates over TLS.

Implementations§

Source§

impl TurnClientDimpl

Source

pub fn allocate( local_addr: SocketAddr, remote_addr: SocketAddr, config: TurnConfig, tls_config: Arc<Config>, ) -> Self

Allocate an address on a TURN server to relay data to and from peers.

Trait Implementations§

Source§

impl Debug for TurnClientDimpl

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl TurnClientApi for TurnClientDimpl

Source§

fn transport(&self) -> TransportType

The transport of the connection to the TURN server.
Source§

fn local_addr(&self) -> SocketAddr

The local address of this TURN client.
Source§

fn remote_addr(&self) -> SocketAddr

The remote TURN server’s address.
Source§

fn poll(&mut self, now: Instant) -> TurnPollRet

Poll the client for further progress.
Source§

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> + '_

The list of permissions available for the provided relayed address.
Source§

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>

Poll for an event that has occurred.
Source§

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>

Create a permission address to allow sending/receiving data to/from.
Source§

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>

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>

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>

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, )

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>

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>

Provide received data to the TURN client for handling. Read more
Source§

fn poll_recv(&mut self, _now: Instant) -> Option<TurnPeerData<Vec<u8>>>

Poll the client for any further received data.
Source§

fn protocol_error(&mut self)

A higher layer has encountered an error and this client is no longer usable.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> CryptoSafe for T