Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions async/src/async_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl Write for ChanIO<'_> {
/// Otherwise ordering will be arbitrary, and if competing readers or writers
/// are in different tasks, there will be churn as they continually wake
/// each other up. Simultaneous single-reader and single-writer is fine.
#[derive(Debug, Clone)]
#[derive(Debug)]
pub struct ChanIn<'g>(ChanIO<'g>);

impl<'g> ChanIn<'g> {
Expand All @@ -134,6 +134,12 @@ impl Drop for ChanIn<'_> {
}
}

impl Clone for ChanIn<'_> {
fn clone(&self) -> Self {
Self::new(self.0.clone())
}
}

/// An output-only SSH channel.
///
/// This is used as stderr for a server, or can also be obtained using
Expand Down Expand Up @@ -187,7 +193,7 @@ impl<'g> ChanOut<'g> {
/// Otherwise ordering will be arbitrary, and if competing readers or writers
/// are in different tasks, there will be churn as they continually wake
/// each other up. Simultaneous single-reader and single-writer is fine.
#[derive(Debug, Clone)]
#[derive(Debug)]
pub struct ChanInOut<'g>(ChanIO<'g>);

impl<'g> ChanInOut<'g> {
Expand Down Expand Up @@ -225,6 +231,12 @@ impl Drop for ChanInOut<'_> {
}
}

impl Clone for ChanInOut<'_> {
fn clone(&self) -> Self {
Self::new(self.0.clone())
}
}

impl ErrorType for ChanInOut<'_> {
type Error = sunset::Error;
}
Expand Down
Loading