pub struct DataChannel { /* private fields */ }
Expand description
DataChannel represents a data channel
Implementations§
Source§impl DataChannel
impl DataChannel
Sourcepub fn dial(
config: Config,
association_handle: usize,
stream_id: u16,
) -> Result<Self>
pub fn dial( config: Config, association_handle: usize, stream_id: u16, ) -> Result<Self>
Dial opens a data channels over SCTP
Sourcepub fn accept(
config: Config,
association_handle: usize,
stream_id: u16,
ppi: PayloadProtocolIdentifier,
buf: &[u8],
) -> Result<Self>
pub fn accept( config: Config, association_handle: usize, stream_id: u16, ppi: PayloadProtocolIdentifier, buf: &[u8], ) -> Result<Self>
Accept is used to accept incoming data channels over SCTP
Sourcepub fn poll_transmit(&mut self) -> Option<DataChannelMessage>
pub fn poll_transmit(&mut self) -> Option<DataChannelMessage>
Returns packets to transmit
Sourcepub fn read(
&mut self,
ppi: PayloadProtocolIdentifier,
buf: &[u8],
) -> Result<BytesMut>
pub fn read( &mut self, ppi: PayloadProtocolIdentifier, buf: &[u8], ) -> Result<BytesMut>
Read reads a packet of len(p) bytes as binary data.
Sourcepub fn read_data_channel(
&mut self,
ppi: PayloadProtocolIdentifier,
buf: &[u8],
) -> Result<(BytesMut, bool)>
pub fn read_data_channel( &mut self, ppi: PayloadProtocolIdentifier, buf: &[u8], ) -> Result<(BytesMut, bool)>
ReadDataChannel reads a packet of len(p) bytes. It returns the number of bytes read and
true
if the data read is a string.
Sourcepub fn messages_sent(&self) -> usize
pub fn messages_sent(&self) -> usize
MessagesSent returns the number of messages sent
Sourcepub fn messages_received(&self) -> usize
pub fn messages_received(&self) -> usize
MessagesReceived returns the number of messages received
Sourcepub fn bytes_sent(&self) -> usize
pub fn bytes_sent(&self) -> usize
BytesSent returns the number of bytes sent
Sourcepub fn bytes_received(&self) -> usize
pub fn bytes_received(&self) -> usize
BytesReceived returns the number of bytes received
Sourcepub fn association_handle(&self) -> usize
pub fn association_handle(&self) -> usize
association_handle returns the association handle
Sourcepub fn stream_identifier(&self) -> u16
pub fn stream_identifier(&self) -> u16
StreamIdentifier returns the Stream identifier associated to the stream.
Trait Implementations§
Source§impl Clone for DataChannel
impl Clone for DataChannel
Source§fn clone(&self) -> DataChannel
fn clone(&self) -> DataChannel
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DataChannel
impl Debug for DataChannel
Source§impl Default for DataChannel
impl Default for DataChannel
Source§fn default() -> DataChannel
fn default() -> DataChannel
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DataChannel
impl RefUnwindSafe for DataChannel
impl Send for DataChannel
impl Sync for DataChannel
impl Unpin for DataChannel
impl UnwindSafe for DataChannel
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