TurnServer

Struct TurnServer 

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

A TURN server.

Implementations§

Source§

impl TurnServer

Source

pub fn new(ttype: TransportType, listen_addr: SocketAddr, realm: String) -> Self

Construct a new TurnServer

§Examples
let realm = String::from("realm");
let listen_addr = "10.0.0.1:3478".parse().unwrap();
let server = TurnServer::new(TransportType::Udp, listen_addr, realm);
assert_eq!(server.listen_address(), listen_addr);
Source

pub fn transport(&self) -> TransportType

The TransportType of this TURN server.

Trait Implementations§

Source§

impl Debug for TurnServer

Source§

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

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

impl TurnServerApi for TurnServer

Source§

fn add_user(&mut self, username: String, password: String)

Add a user credentials that would be accepted by this TurnServerApi.
Source§

fn listen_address(&self) -> SocketAddr

The address that the TurnServerApi is listening on for incoming client connections.
Source§

fn set_nonce_expiry_duration(&mut self, expiry_duration: Duration)

Set the amount of time that a Nonce (used for authentication) will expire and a new Nonce will need to be acquired by a client.
Source§

fn recv_icmp<T: AsRef<[u8]>>( &mut self, family: AddressFamily, bytes: T, now: Instant, ) -> Option<Transmit<Vec<u8>>>

Provide a received ICMP packet to the TurnServerApi. Read more
Source§

fn recv<T: AsRef<[u8]> + Debug>( &mut self, transmit: Transmit<T>, now: Instant, ) -> Option<TransmitBuild<DelayedMessageOrChannelSend<T>>>

Provide received data to the TurnServerApi. Read more
Source§

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

Poll the TurnServerApi in order to make further progress. Read more
Source§

fn poll_transmit(&mut self, now: Instant) -> Option<Transmit<Vec<u8>>>

Poll for a new Transmit to send over a socket.
Source§

fn allocated_udp_socket( &mut self, transport: TransportType, local_addr: SocketAddr, remote_addr: SocketAddr, family: AddressFamily, socket_addr: Result<SocketAddr, SocketAllocateError>, now: Instant, )

Notify the TurnServerApi that a UDP socket has been allocated (or an error) in response to TurnServerPollRet::AllocateSocketUdp.

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