diff options
-rw-r--r-- | CHANGELOG.md | 6 | ||||
-rw-r--r-- | Cargo.toml | 6 | ||||
-rw-r--r-- | src/lib.rs | 6 | ||||
-rw-r--r-- | src/reader.rs | 6 | ||||
-rw-r--r-- | src/writer.rs | 6 |
5 files changed, 18 insertions, 12 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index f0a9293..035e9f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased] + +### Changed + +* moved to tokio + ## [0.3.3] - 2021-12-15 ### Fixed @@ -13,8 +13,8 @@ categories = ["parser-implementations"] include = ["src/**/*", "LICENSE", "README.md", "CHANGELOG.md"] [dependencies] -futures-lite = { version = "1.12.0", optional = true } +tokio = { version = "1.17.0", optional = true, features = ["io-util"] } [features] -default = ["async"] -async = ["futures-lite"] +default = [] +async = ["tokio"] @@ -7,9 +7,9 @@ //! `blocking::Writer` provide a similar API for non-asynchronous //! applications. //! -//! If you do not need the async API, the `futures` dependency can be removed -//! by building with `default_features = false` (by default, the `"async"` -//! feature is enabled). +//! # Features +//! +//! Async support via Tokio can be enabled via the `"async"` feature. #![warn(clippy::cargo)] #![warn(clippy::pedantic)] diff --git a/src/reader.rs b/src/reader.rs index 3426dcb..0b0666b 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -1,13 +1,13 @@ -use futures_lite::io::AsyncReadExt as _; +use tokio::io::AsyncReadExt as _; /// Reads ttyrec frames from a [`futures_lite::io::AsyncRead`] instance. -pub struct Reader<T: futures_lite::io::AsyncRead> { +pub struct Reader<T: tokio::io::AsyncRead> { input: T, parser: crate::Parser, buf: [u8; 4096], } -impl<T: futures_lite::io::AsyncRead + std::marker::Unpin + Send> Reader<T> { +impl<T: tokio::io::AsyncRead + std::marker::Unpin + Send> Reader<T> { /// Creates a new [`Reader`](Self) from a [`futures_lite::io::AsyncRead`] /// instance. pub fn new(input: T) -> Self { diff --git a/src/writer.rs b/src/writer.rs index 9eb3aaa..6e52db1 100644 --- a/src/writer.rs +++ b/src/writer.rs @@ -1,12 +1,12 @@ -use futures_lite::io::AsyncWriteExt as _; +use tokio::io::AsyncWriteExt as _; /// Writes ttyrec frames to a [`futures_lite::io::AsyncWrite`] instance. -pub struct Writer<T: futures_lite::io::AsyncWrite> { +pub struct Writer<T: tokio::io::AsyncWrite> { output: T, creator: crate::Creator, } -impl<T: futures_lite::io::AsyncWrite + std::marker::Unpin + Send> Writer<T> { +impl<T: tokio::io::AsyncWrite + std::marker::Unpin + Send> Writer<T> { /// Creates a new [`Writer`](Self) from a [`futures_lite::io::AsyncWrite`] /// instance. pub fn new(output: T) -> Self { |