use super::{BoundsExceeded, VarInt};
use std::str;
use thiserror::Error;
pub trait AsyncRead: tokio::io::AsyncRead + Unpin + Send {}
impl AsyncRead for webtransport_quinn::RecvStream {}
#[derive(Error, Debug)]
pub enum DecodeError {
#[error("unexpected end of buffer")]
UnexpectedEnd,
#[error("invalid string")]
InvalidString(#[from] str::Utf8Error),
#[error("invalid type: {0:?}")]
InvalidType(VarInt),
#[error("varint bounds exceeded")]
BoundsExceeded(#[from] BoundsExceeded),
#[error("io error: {0}")]
IoError(#[from] std::io::Error),
}