kixelated 88542e266c
Major moq-transport API simplification (#68)
Exponentially easier to use moq-transport as there's no message handling required. This is a BREAKING CHANGE.
2023-09-15 12:06:28 -07:00

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),
}