Exponentially easier to use moq-transport as there's no message handling required. This is a BREAKING CHANGE.
22 lines
564 B
Rust
22 lines
564 B
Rust
use super::BoundsExceeded;
|
|
|
|
use thiserror::Error;
|
|
|
|
// I'm too lazy to add these trait bounds to every message type.
|
|
// TODO Use trait aliases when they're stable, or add these bounds to every method.
|
|
pub trait AsyncWrite: tokio::io::AsyncWrite + Unpin + Send {}
|
|
impl AsyncWrite for webtransport_quinn::SendStream {}
|
|
|
|
/// An encode error.
|
|
#[derive(Error, Debug)]
|
|
pub enum EncodeError {
|
|
#[error("varint too large")]
|
|
BoundsExceeded(#[from] BoundsExceeded),
|
|
|
|
#[error("invalid value")]
|
|
InvalidValue,
|
|
|
|
#[error("i/o error: {0}")]
|
|
IoError(#[from] std::io::Error),
|
|
}
|