pub struct Relay<'a> { /* private fields */ }Expand description
A borrowed handle to one live allocation on the TURN server.
Obtained from Client::relay. Sending to a peer requires
a permission for it first — see Self::create_permission.
Implementations§
Source§impl Relay<'_>
impl Relay<'_>
Sourcepub fn create_permission(
&mut self,
peer_addr: SocketAddr,
) -> Result<Option<TransactionId>>
pub fn create_permission( &mut self, peer_addr: SocketAddr, ) -> Result<Option<TransactionId>>
Asks the server to permit traffic to and from peer_addr.
The relay silently drops data for peers with no permission, and permissions expire after
five minutes unless refreshed. Returns the transaction id to match against the resulting
Event, or None if a permission is already in place.
§Errors
Fails if the allocation no longer exists or the request cannot be encoded.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Relay<'a>
impl<'a> !UnwindSafe for Relay<'a>
impl<'a> Freeze for Relay<'a>
impl<'a> Send for Relay<'a>
impl<'a> Sync for Relay<'a>
impl<'a> Unpin for Relay<'a>
impl<'a> UnsafeUnpin for Relay<'a>
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