Struct matchbox_socket::WebRtcChannel
source · pub struct WebRtcChannel { /* private fields */ }
Expand description
Used to send and receive packets on a given WebRTC channel. Must be created as part of a
WebRtcSocket
.
Implementations§
source§impl WebRtcChannel
impl WebRtcChannel
sourcepub fn close(&mut self)
pub fn close(&mut self)
Close this channel.
This prevents sending and receiving any messages in the future, but does not drain messages that are buffered.
sourcepub fn receive(&mut self) -> Vec<(PeerId, Packet)>
pub fn receive(&mut self) -> Vec<(PeerId, Packet)>
Call this where you want to handle new received messages. Returns immediately.
Messages are removed from the socket when called.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WebRtcChannel
impl Send for WebRtcChannel
impl Sync for WebRtcChannel
impl Unpin for WebRtcChannel
impl !UnwindSafe for WebRtcChannel
Blanket Implementations§
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
Mutably borrows from an owned value. Read more