Struct datachannel::RtcDataChannel
source · [−]pub struct RtcDataChannel<D> { /* private fields */ }
Implementations
sourceimpl<D> RtcDataChannel<D>where
D: DataChannelHandler + Send,
impl<D> RtcDataChannel<D>where
D: DataChannelHandler + Send,
pub fn send(&mut self, msg: &[u8]) -> Result<()>
pub fn label(&self) -> String
pub fn protocol(&self) -> Option<String>
pub fn reliability(&self) -> Reliability
pub fn stream(&self) -> usize
sourcepub fn buffered_amount(&self) -> usize
pub fn buffered_amount(&self) -> usize
Number of bytes currently queued to be sent over the data channel.
This method is the counterpart of available_amount
.
sourcepub fn set_buffered_amount_low_threshold(&mut self, amount: usize) -> Result<()>
pub fn set_buffered_amount_low_threshold(&mut self, amount: usize) -> Result<()>
Sets the lower threshold of buffered_amount
.
The default value is 0. When the number of buffered outgoing bytes, as indicated
by buffered_amount
, falls to or below this value, a
on_bufferd_amount_low
event is fired. This event may be used, for example,
to implement code which queues more messages to be sent whenever there’s room to
buffer them.
sourcepub fn available_amount(&self) -> usize
pub fn available_amount(&self) -> usize
Number of bytes currently queued to be consumed from the data channel.
This method is the counterpart of buffered_amount
.
Trait Implementations
Auto Trait Implementations
impl<D> RefUnwindSafe for RtcDataChannel<D>where
D: RefUnwindSafe,
impl<D> Send for RtcDataChannel<D>where
D: Send,
impl<D> Sync for RtcDataChannel<D>where
D: Sync,
impl<D> Unpin for RtcDataChannel<D>where
D: Unpin,
impl<D> UnwindSafe for RtcDataChannel<D>where
D: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more