pub struct TurnServer { /* private fields */ }Expand description
A TURN server.
Implementations§
Source§impl TurnServer
impl TurnServer
Sourcepub fn new(ttype: TransportType, listen_addr: SocketAddr, realm: String) -> Self
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);Sourcepub fn transport(&self) -> TransportType
pub fn transport(&self) -> TransportType
The TransportType of this TURN server.
Trait Implementations§
Source§impl Debug for TurnServer
impl Debug for TurnServer
Source§impl TurnServerApi for TurnServer
impl TurnServerApi for TurnServer
Source§fn add_user(&mut self, username: String, password: String)
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
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)
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>>>
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 moreSource§fn recv<T: AsRef<[u8]> + Debug>(
&mut self,
transmit: Transmit<T>,
now: Instant,
) -> Option<TransmitBuild<DelayedMessageOrChannelSend<T>>>
fn recv<T: AsRef<[u8]> + Debug>( &mut self, transmit: Transmit<T>, now: Instant, ) -> Option<TransmitBuild<DelayedMessageOrChannelSend<T>>>
Provide received data to the
TurnServerApi. Read moreSource§fn poll(&mut self, now: Instant) -> TurnServerPollRet
fn poll(&mut self, now: Instant) -> TurnServerPollRet
Poll the
TurnServerApi in order to make further progress. Read moreSource§fn poll_transmit(&mut self, now: Instant) -> Option<Transmit<Vec<u8>>>
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,
)
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§
impl Freeze for TurnServer
impl RefUnwindSafe for TurnServer
impl Send for TurnServer
impl Sync for TurnServer
impl Unpin for TurnServer
impl UnwindSafe for TurnServer
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