pub struct FramedRecvStream { /* private fields */ }Expand description
A framed reader for a recv stream. Handles MoQT varint-length decoding.
Implementations§
Source§impl FramedRecvStream
impl FramedRecvStream
Sourcepub fn new(inner: RecvStream, draft: DraftVersion) -> Self
pub fn new(inner: RecvStream, draft: DraftVersion) -> Self
Create a new framed receive stream for the given draft version.
Sourcepub async fn read_control(
&mut self,
capture_raw: bool,
) -> Result<(AnyControlMessage, Option<Vec<u8>>), ConnectionError>
pub async fn read_control( &mut self, capture_raw: bool, ) -> Result<(AnyControlMessage, Option<Vec<u8>>), ConnectionError>
Read a control message from the stream.
When capture_raw is true, the returned tuple includes a clone of the
framed wire bytes (for observer emission). When false, the second
element is None and the payload clone is skipped.
Sourcepub async fn read_subgroup_header(
&mut self,
) -> Result<AnySubgroupHeader, ConnectionError>
pub async fn read_subgroup_header( &mut self, ) -> Result<AnySubgroupHeader, ConnectionError>
Read a subgroup stream header. Also initializes the internal delta-decoding state.
Sourcepub async fn read_fetch_header(
&mut self,
) -> Result<AnyFetchHeader, ConnectionError>
pub async fn read_fetch_header( &mut self, ) -> Result<AnyFetchHeader, ConnectionError>
Read a fetch response header.
Sourcepub async fn read_subgroup_object(
&mut self,
) -> Result<SubgroupObject, ConnectionError>
pub async fn read_subgroup_object( &mut self, ) -> Result<SubgroupObject, ConnectionError>
Read the next draft-15 subgroup object from this stream. Uses
the stateful reader seeded by
FramedRecvStream::read_subgroup_header to decode the
delta-encoded object ID and (when the stream type says so) the
extension block. Returns an error if called before a subgroup
header was read.
Sourcepub async fn read_fetch_stream_header(
&mut self,
) -> Result<FetchHeader, ConnectionError>
pub async fn read_fetch_stream_header( &mut self, ) -> Result<FetchHeader, ConnectionError>
Read the next draft-15 fetch header from this stream.
Sourcepub fn draft(&self) -> DraftVersion
pub fn draft(&self) -> DraftVersion
Returns the draft version this stream is framed for.