pub struct FramedSendStream {
inner: SendStream,
draft: DraftVersion,
subgroup_io: Option<SubgroupObjectReader>,
}Expand description
A framed writer for a send stream. Handles MoQT length-prefixed framing.
Fields§
§inner: SendStream§draft: DraftVersion§subgroup_io: Option<SubgroupObjectReader>Stateful subgroup object writer.
Implementations§
Source§impl FramedSendStream
impl FramedSendStream
Sourcepub fn new(inner: SendStream, draft: DraftVersion) -> Self
pub fn new(inner: SendStream, draft: DraftVersion) -> Self
Create a new framed send stream for the given draft version.
Sourcepub async fn write_control(
&mut self,
msg: &AnyControlMessage,
) -> Result<Vec<u8>, ConnectionError>
pub async fn write_control( &mut self, msg: &AnyControlMessage, ) -> Result<Vec<u8>, ConnectionError>
Write a control message to the stream with type+length framing. Returns the raw bytes that were written (for event capture).
Sourcepub async fn write_subgroup_header(
&mut self,
header: &AnySubgroupHeader,
) -> Result<(), ConnectionError>
pub async fn write_subgroup_header( &mut self, header: &AnySubgroupHeader, ) -> Result<(), ConnectionError>
Write a subgroup stream header. Also initializes the internal
delta-encoding state used by
FramedSendStream::write_subgroup_object.
Sourcepub async fn write_fetch_header(
&mut self,
header: &AnyFetchHeader,
) -> Result<(), ConnectionError>
pub async fn write_fetch_header( &mut self, header: &AnyFetchHeader, ) -> Result<(), ConnectionError>
Write a fetch response header.
Sourcepub async fn write_subgroup_object(
&mut self,
object: &SubgroupObject,
) -> Result<(), ConnectionError>
pub async fn write_subgroup_object( &mut self, object: &SubgroupObject, ) -> Result<(), ConnectionError>
Append a draft-16 subgroup object to the stream using the
stateful writer seeded from
FramedSendStream::write_subgroup_header.
Sourcepub async fn finish(&mut self) -> Result<(), ConnectionError>
pub async fn finish(&mut self) -> Result<(), ConnectionError>
Finish the stream (send FIN).
Auto Trait Implementations§
impl Freeze for FramedSendStream
impl RefUnwindSafe for FramedSendStream
impl Send for FramedSendStream
impl Sync for FramedSendStream
impl Unpin for FramedSendStream
impl UnsafeUnpin for FramedSendStream
impl UnwindSafe for FramedSendStream
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