pub struct MuxStream {
pub stream_id: u32,
/* private fields */
}
Expand description
Multiplexor stream.
Fields§
§stream_id: u32
ID of the stream.
Implementations§
source§impl MuxStream
impl MuxStream
sourcepub fn get_close_handle(&self) -> MuxStreamCloser
pub fn get_close_handle(&self) -> MuxStreamCloser
Get a handle to close the connection.
Useful to close the connection without having access to the stream.
§Example
let handle = stream.get_close_handle();
if let Err(error) = handle_stream(stream) {
handle.close(0x01);
}
sourcepub fn get_protocol_extension_stream(&self) -> MuxProtocolExtensionStream
pub fn get_protocol_extension_stream(&self) -> MuxProtocolExtensionStream
Get a protocol extension stream to send protocol extension packets.
sourcepub async fn close(&self, reason: CloseReason) -> Result<(), WispError>
pub async fn close(&self, reason: CloseReason) -> Result<(), WispError>
Close the stream. You will no longer be able to write or read after this has been called.
sourcepub fn into_split(self) -> (MuxStreamRead, MuxStreamWrite)
pub fn into_split(self) -> (MuxStreamRead, MuxStreamWrite)
Split the stream into read and write parts, consuming it.
sourcepub fn into_io(self) -> MuxStreamIo
pub fn into_io(self) -> MuxStreamIo
Turn the stream into one that implements futures Stream + Sink
, consuming it.
Auto Trait Implementations§
impl !Freeze for MuxStream
impl !RefUnwindSafe for MuxStream
impl Send for MuxStream
impl Sync for MuxStream
impl Unpin for MuxStream
impl !UnwindSafe for MuxStream
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