Peekable reader and async reader, which enhance your network programming experience.
English | 简体中文
Installation
-
Std
[] = "0.2"
-
Tokio I/O
[] = { = "0.2", = ["tokio"] }
-
Futures I/O
[] = { = "0.2", = ["future"] }
Examples
-
Std
use ; use Peekable; let conn = connect.unwrap; let mut peekable = from; let mut peeked = ; peekable.peek_exact.unwrap; let mut readed = ; peekable.read_exact.unwrap; assert_eq!;
-
Tokio I/O
use ; use AsyncPeekable; let conn = connect.await.unwrap; let mut peekable = from; let mut peeked = ; peekable.peek_exact.await.unwrap; let mut readed = ; peekable.read_exact.await.unwrap; assert_eq!;
-
Futures I/O
use TcpStream; use AsyncReadExt; use AsyncPeekable; let conn = connect.await.unwrap; let mut peekable = from; let mut peeked = ; peekable.peek_exact.await.unwrap; let mut readed = ; peekable.read_exact.await.unwrap; assert_eq!;
License
peekable
is under the terms of both the MIT license and the
Apache License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT for details.
Copyright (c) 2024 Al Liu.