22 lines
451 B
Rust
22 lines
451 B
Rust
use crate::reader::utils::AsyncPeek;
|
|
use tokio::io::AsyncBufRead;
|
|
|
|
pub struct ProtoReader<R>
|
|
where
|
|
R: AsyncBufRead + AsyncPeek + Unpin + Send,
|
|
{
|
|
pub(super) inner: R,
|
|
pub(super) msg_len_limit: i32,
|
|
}
|
|
|
|
impl<R> ProtoReader<R>
|
|
where
|
|
R: AsyncBufRead + AsyncPeek + Unpin + Send,
|
|
{
|
|
pub fn new(reader: R, msg_len_limit: i32) -> ProtoReader<R> {
|
|
ProtoReader {
|
|
inner: reader,
|
|
msg_len_limit,
|
|
}
|
|
}
|
|
}
|