use crate::{coding::DecodeError, message::Message}; use webtransport_generic::RecvStream; pub struct Receiver { stream: R, } impl Receiver { pub fn new(stream: R) -> Self { Self { stream } } // Read the next full message from the stream. // NOTE: This is not cancellable; you must poll the future to completion. pub async fn recv(&mut self) -> Result { Message::decode(&mut self.stream).await } }