pub struct FramedRecvStream {
inner: RecvStream,
buf: BytesMut,
}Expand description
A framed reader for a QUIC recv stream. Handles MoQT varint-length decoding.
Fields§
§inner: RecvStream§buf: BytesMutImplementations§
Source§impl FramedRecvStream
impl FramedRecvStream
pub fn new(inner: RecvStream) -> Self
Sourceasync fn fill(&mut self) -> Result<bool, ConnectionError>
async fn fill(&mut self) -> Result<bool, ConnectionError>
Read more data from the stream into the internal buffer.
Sourceasync fn ensure(&mut self, n: usize) -> Result<(), ConnectionError>
async fn ensure(&mut self, n: usize) -> Result<(), ConnectionError>
Ensure at least n bytes are available in the buffer.
Sourcepub async fn read_control(&mut self) -> Result<ControlMessage, ConnectionError>
pub async fn read_control(&mut self) -> Result<ControlMessage, ConnectionError>
Read a control message from the stream.
Sourcepub async fn read_subgroup_header(
&mut self,
) -> Result<SubgroupHeader, ConnectionError>
pub async fn read_subgroup_header( &mut self, ) -> Result<SubgroupHeader, ConnectionError>
Read a subgroup stream header.
Sourcepub async fn read_fetch_header(
&mut self,
) -> Result<FetchHeader, ConnectionError>
pub async fn read_fetch_header( &mut self, ) -> Result<FetchHeader, ConnectionError>
Read a fetch response header.
Sourcepub async fn read_object_header(
&mut self,
) -> Result<ObjectHeader, ConnectionError>
pub async fn read_object_header( &mut self, ) -> Result<ObjectHeader, ConnectionError>
Read an object header.
Sourcepub async fn read_payload(
&mut self,
n: usize,
) -> Result<Vec<u8>, ConnectionError>
pub async fn read_payload( &mut self, n: usize, ) -> Result<Vec<u8>, ConnectionError>
Read exactly n bytes of object payload.
Auto Trait Implementations§
impl Freeze for FramedRecvStream
impl RefUnwindSafe for FramedRecvStream
impl Send for FramedRecvStream
impl Sync for FramedRecvStream
impl Unpin for FramedRecvStream
impl UnsafeUnpin for FramedRecvStream
impl UnwindSafe for FramedRecvStream
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more