aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-04 03:50:22 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-04 03:50:22 -0500
commit57f245da290fee5a1cb2e9526fd30df3a2fb379d (patch)
tree9a881db398840a976cb9af30fbea348535fe5100 /src/writer.rs
parent3ba8bad931571f9a2586dd02d50415dc8428ed41 (diff)
downloadttyrec-57f245da290fee5a1cb2e9526fd30df3a2fb379d.tar.gz
ttyrec-57f245da290fee5a1cb2e9526fd30df3a2fb379d.zip
fix doc links0.3.0
Diffstat (limited to 'src/writer.rs')
-rw-r--r--src/writer.rs13
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,