diff options
Diffstat (limited to 'src/writer.rs')
-rw-r--r-- | src/writer.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/writer.rs b/src/writer.rs index 6975ad1..f161df0 100644 --- a/src/writer.rs +++ b/src/writer.rs @@ -1,13 +1,14 @@ use futures::io::AsyncWriteExt as _; -/// Writes ttyrec frames to a `futures::io::AsyncWrite` instance. +/// Writes ttyrec frames to a [`futures::io::AsyncWrite`] instance. pub struct Writer<T: futures::io::AsyncWrite> { output: T, creator: crate::Creator, } impl<T: futures::io::AsyncWrite + std::marker::Unpin + Send> Writer<T> { - /// Creates a new `Writer` from a `futures::io::AsyncWrite` instance. + /// Creates a new [`Writer`](Self) from a [`futures::io::AsyncWrite`] + /// instance. pub fn new(output: T) -> Self { Self { output, @@ -19,8 +20,8 @@ impl<T: futures::io::AsyncWrite + std::marker::Unpin + Send> Writer<T> { /// given data. /// /// # Errors - /// * `crate::Error::Write`: There was an error writing to the input - /// stream. + /// * [`Error::Write`](crate::Error::Write): There was an error writing to + /// the input stream. pub async fn frame(&mut self, data: &[u8]) -> crate::Result<()> { self.frame_at(std::time::Instant::now(), data).await } @@ -29,8 +30,8 @@ impl<T: futures::io::AsyncWrite + std::marker::Unpin + Send> Writer<T> { /// data. /// /// # Errors - /// * `crate::Error::Write`: There was an error writing to the input - /// stream. + /// * [`Error::Write`](crate::Error::Write): There was an error writing to + /// the input stream. pub async fn frame_at( &mut self, cur_time: std::time::Instant, |