pub struct DataChannel {
    pub config: Config,
    /* private fields */
}
Expand description

DataChannel represents a data channel

Fields

config: Config

Implementations

Dial opens a data channels over SCTP

Accept is used to accept incoming data channels over SCTP

Client opens a data channel over an SCTP stream

Server accepts a data channel over an SCTP stream

Read reads a packet of len(p) bytes as binary data.

See sctp::stream::Stream::read_sctp.

ReadDataChannel reads a packet of len(p) bytes. It returns the number of bytes read and true if the data read is a string.

See sctp::stream::Stream::read_sctp.

MessagesSent returns the number of messages sent

MessagesReceived returns the number of messages received

BytesSent returns the number of bytes sent

BytesReceived returns the number of bytes received

StreamIdentifier returns the Stream identifier associated to the stream.

Write writes len(p) bytes from p as binary data

WriteDataChannel writes len(p) bytes from p

Close closes the DataChannel and the underlying SCTP stream.

BufferedAmount returns the number of bytes of data currently queued to be sent over this stream.

BufferedAmountLowThreshold returns the number of bytes of buffered outgoing data that is considered “low.” Defaults to 0.

SetBufferedAmountLowThreshold is used to update the threshold. See BufferedAmountLowThreshold().

OnBufferedAmountLow sets the callback handler which would be called when the number of bytes of outgoing data buffered is lower than the threshold.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.