Struct webrtc_sctp::stream::Stream

source ·
pub struct Stream { /* private fields */ }
Expand description

Stream represents an SCTP stream

Implementations

stream_identifier returns the Stream identifier associated to the stream.

set_default_payload_type sets the default payload type used by write.

set_reliability_params sets reliability parameters for this stream.

Reads a packet of len(p) bytes, dropping the Payload Protocol Identifier.

Returns Error::ErrShortBuffer if p is too short. Returns 0 if the reading half of this stream is shutdown or it (the stream) was reset.

Reads a packet of len(p) bytes and returns the associated Payload Protocol Identifier.

Returns Error::ErrShortBuffer if p is too short. Returns (0, PayloadProtocolIdentifier::Unknown) if the reading half of this stream is shutdown or it (the stream) was reset.

Writes p to the DTLS connection with the default Payload Protocol Identifier.

Returns an error if the write half of this stream is shutdown or p is too large.

Writes p to the DTLS connection with the given Payload Protocol Identifier.

Returns an error if the write half of this stream is shutdown or p is too large.

👎Deprecated

Closes both read and write halves of this stream.

Use Stream::shutdown instead.

Shuts down the read, write, or both halves of this stream.

This function will cause all pending and future I/O on the specified portions to return immediately with an appropriate value (see the documentation of Shutdown).

Resets the stream when both halves of this stream are shutdown.

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

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

set_buffered_amount_low_threshold is used to update the threshold. See buffered_amount_low_threshold().

on_buffered_amount_low 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.
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 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.