Skip to content

Commit

Permalink
stream: getters for inner stream in the BiStream
Browse files Browse the repository at this point in the history
  • Loading branch information
BiagioFesta committed Aug 24, 2024
1 parent f7e809c commit aaeea09
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions wtransport/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,26 @@ impl BiStream {
pub fn split(self) -> (SendStream, RecvStream) {
self.0
}

/// Returns a reference to the inner [`SendStream`].
pub fn send(&self) -> &SendStream {
&self.0 .0
}

/// Returns a mutable reference to the inner [`SendStream`].
pub fn send_mut(&mut self) -> &mut SendStream {
&mut self.0 .0
}

/// Returns a reference to the inner [`RecvStream`].
pub fn recv(&self) -> &RecvStream {
&self.0 .1
}

/// Returns a mutable reference to the inner [`RecvStream`].
pub fn recv_mut(&mut self) -> &mut RecvStream {
&mut self.0 .1
}
}

impl From<(SendStream, RecvStream)> for BiStream {
Expand Down

0 comments on commit aaeea09

Please sign in to comment.