Skip to content

Commit

Permalink
Implement Clone for Channel
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 9c0017a commit fd72f64
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 @@ -35,6 +35,13 @@ struct LockedChannel<'a> {
/// implements the `Reader` and `Writer` traits to send and receive data.
/// Whether or not I/O operations are blocking is mandated by the `blocking`
/// flag on a channel's corresponding `Session`.
///
/// You may clone a `Channel` to obtain another handle to the same underlying
/// channel, 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 Channel {
channel_inner: Arc<ChannelInner>,
}
Expand Down

0 comments on commit fd72f64

Please sign in to comment.