pub struct PeerDriver { /* private fields */ }Expand description
Drives an RTCPeerConnection over sockets of its own (see the module documentation).
Implementations§
Source§impl PeerDriver
impl PeerDriver
Sourcepub fn new(pc: RTCPeerConnection, config: PeerDriverConfig) -> Self
pub fn new(pc: RTCPeerConnection, config: PeerDriverConfig) -> Self
A driver for pc, with no socket yet: it binds when the connection’s first local
description begins gathering. Must be used inside a tokio runtime.
Sourcepub fn pc(&self) -> &RTCPeerConnection
pub fn pc(&self) -> &RTCPeerConnection
The peer connection.
Sourcepub fn pc_mut(&mut self) -> &mut RTCPeerConnection
pub fn pc_mut(&mut self) -> &mut RTCPeerConnection
Sourcepub fn local_addresses(&self) -> Vec<SocketAddr>
pub fn local_addresses(&self) -> Vec<SocketAddr>
The local addresses of the UDP sockets open, the previous ones still waiting for a new pair included.
Sourcepub fn unsent_datagrams(&self) -> u64
pub fn unsent_datagrams(&self) -> u64
How many datagrams the connection wrote that were not sent: from a local address with no open socket (one closed already), or refused by the socket (its send buffer full: UDP drops them, as the wire would). Counted so that none is lost unseen.
Sourcepub fn poll_event(&mut self) -> Option<RTCPeerConnectionEvent>
pub fn poll_event(&mut self) -> Option<RTCPeerConnectionEvent>
The next event of the connection. The driver has already done what is its to do
(gathering on OnLocalCandidatesNeeded and when a transport begins gathering, closing
the previous sockets on a new selected pair); the application signals the candidates
of OnIceCandidateEvent to the peer and handles the rest.
Sourcepub fn flush(&mut self) -> Result<()>
pub fn flush(&mut self) -> Result<()>
Hands what the connection wants to send to the sockets and the stream driver, and reacts to its events, until nothing is left.
§Errors
A socket that cannot be bound for a transport that needs one, or a candidate the connection refuses.
Auto Trait Implementations§
impl !Freeze for PeerDriver
impl !RefUnwindSafe for PeerDriver
impl !Sync for PeerDriver
impl !UnwindSafe for PeerDriver
impl Forget for PeerDriver
impl Move for PeerDriver
impl Send for PeerDriver
impl Unpin for PeerDriver
impl UnsafeUnpin for PeerDriver
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.