Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::task::{Context, Poll};
use tokio::io::{self, AsyncRead, ReadBuf};

/// The read half of the pipe which implements [`AsyncRead`](https://docs.rs/tokio/0.2.15/tokio/io/trait.AsyncRead.html).
#[derive(Clone)]
pub struct PipeReader {
pub(crate) state: Arc<Mutex<State>>,
}
Expand Down Expand Up @@ -59,6 +60,7 @@ impl PipeReader {
let len = data.len.min(buf.capacity());
unsafe {
ptr::copy_nonoverlapping(data.ptr, buf.initialize_unfilled().as_mut_ptr(), len);
buf.advance(len);
}
len
}
Expand Down
1 change: 1 addition & 0 deletions src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::task::{Context, Poll};
use tokio::io::{self, AsyncWrite};

/// The write half of the pipe which implements [`AsyncWrite`](https://docs.rs/tokio/0.2.16/tokio/io/trait.AsyncWrite.html).
#[derive(Clone)]
pub struct PipeWriter {
pub(crate) state: Arc<Mutex<State>>,
}
Expand Down