aboutsummaryrefslogtreecommitdiffstats
path: root/src/reader.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/reader.rs')
-rw-r--r--src/reader.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/reader.rs b/src/reader.rs
index 6641bb9..240c78e 100644
--- a/src/reader.rs
+++ b/src/reader.rs
@@ -1,6 +1,6 @@
use futures::io::AsyncReadExt as _;
-/// Reads ttyrec frames from a `futures::io::AsyncRead` instance.
+/// Reads ttyrec frames from a [`futures::io::AsyncRead`] instance.
pub struct Reader<T: futures::io::AsyncRead> {
input: T,
parser: crate::Parser,
@@ -8,7 +8,8 @@ pub struct Reader<T: futures::io::AsyncRead> {
}
impl<T: futures::io::AsyncRead + std::marker::Unpin + Send> Reader<T> {
- /// Creates a new `Reader` from a `futures::io::AsyncRead` instance.
+ /// Creates a new [`Reader`](Self) from a [`futures::io::AsyncRead`]
+ /// instance.
pub fn new(input: T) -> Self {
Self {
input,
@@ -20,9 +21,9 @@ impl<T: futures::io::AsyncRead + std::marker::Unpin + Send> Reader<T> {
/// Returns the next parsed frame from the input stream.
///
/// # Errors
- /// * `crate::Error::EOF`: The input stream has been closed.
- /// * `crate::Error::Read`: There was an error reading from the input
- /// stream.
+ /// * [`Error::EOF`](crate::Error::EOF): The input stream has been closed.
+ /// * [`Error::Read`](crate::Error::Read): There was an error reading from
+ /// the input stream.
pub async fn read_frame(&mut self) -> crate::Result<crate::Frame> {
loop {
if let Some(frame) = self.parser.next_frame() {
@@ -42,7 +43,7 @@ impl<T: futures::io::AsyncRead + std::marker::Unpin + Send> Reader<T> {
/// How much the timestamps in this file should be offset by.
///
- /// See `Parser::offset`.
+ /// See [`Parser::offset`](crate::Parser::offset).
pub fn offset(&self) -> Option<std::time::Duration> {
self.parser.offset()
}