Skip to content

Commit

Permalink
Implement Clone for Stream
Browse files Browse the repository at this point in the history
This is safe due to interior locking.
  • Loading branch information
jwueller authored and yodaldevoid committed Mar 18, 2024
1 parent fd72f64 commit 29c4a92
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ impl Channel {

/// A channel can have a number of streams, each identified by an id, each of
/// which implements the `Read` and `Write` traits.
///
/// You may clone a `Stream` to obtain another handle to the same underlying
/// stream, but note that all clones will share the same underlying SSH
/// session and will be subject to the same blocking behavior. For more details
/// on the implications of cloning and blocking operations, refer to the
/// `Session` documentation.
#[derive(Clone)]
pub struct Stream {
channel_inner: Arc<ChannelInner>,
id: i32,
Expand Down

0 comments on commit 29c4a92

Please sign in to comment.