diff options
Diffstat (limited to 'src/creator.rs')
-rw-r--r-- | src/creator.rs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/creator.rs b/src/creator.rs index f4745cc..590d282 100644 --- a/src/creator.rs +++ b/src/creator.rs @@ -1,35 +1,36 @@ /// Creates ttyrec frames. /// /// A ttyrec file is a stream of concatenated frames. This struct creates -/// `Frame` objects, which can be serialized to bytes using their `try_from` -/// implementation, and then a ttyrec file can be generated by concatenating -/// those byte strings. +/// [`Frame`](crate::Frame) objects, which can be serialized to bytes using +/// their `try_from` implementation, and then a ttyrec file can be generated +/// by concatenating those byte strings. #[derive(Debug, Clone)] pub struct Creator { base_time: Option<std::time::Instant>, } impl Creator { - /// Creates a new `Creator` instance. + /// Creates a new [`Creator`] instance. #[must_use] pub fn new() -> Self { Self::default() } - /// Returns a new `Frame` object containing the given data. + /// Returns a new [`Frame`](crate::Frame) object containing the given + /// data. /// - /// Equivalent to calling `frame_at` and passing - /// `std::time::Instant::now()` as the `cur_time` parameter. + /// Equivalent to calling [`frame_at`](Self::frame_at) and passing + /// [`std::time::Instant::now()`] as the `cur_time` parameter. pub fn frame(&mut self, data: &[u8]) -> crate::frame::Frame { self.frame_at(std::time::Instant::now(), data) } - /// Returns a new `Frame` object containing the given data at the given - /// time. + /// Returns a new [`Frame`](crate::Frame) object containing the given data + /// at the given time. /// /// Note that this is not guaranteed to do the correct thing unless the - /// `cur_time` parameters given in each `frame_at` call are - /// non-decreasing. + /// `cur_time` parameters given in each [`frame_at`](Self::frame_at) call + /// are non-decreasing. #[allow(clippy::missing_panics_doc)] pub fn frame_at( &mut self, |