Skip to main content

AnySubgroupWriter

Enum AnySubgroupWriter 

Source
pub enum AnySubgroupWriter {
Show 15 variants Draft07(FramedSendStream), Draft08(FramedSendStream), Draft09(FramedSendStream), Draft10(FramedSendStream), Draft11(FramedSendStream), Draft12(FramedSendStream), Draft13(FramedSendStream), Draft14(FramedSendStream), Draft15(FramedSendStream), Draft16(FramedSendStream), Draft17(FramedSendStream), Draft18(FramedSendStream), Draft19(FramedSendStream), Draft20(FramedSendStream), Draft21(FramedSendStream),
}
Expand description

A subgroup stream this endpoint opened and is writing objects to.

Returned by AnyConnection::open_subgroup. The header is already on the wire by the time this exists — opening the stream and framing it are one step, because a unidirectional stream with no header on it is not a subgroup stream and there is nothing a caller could do with one.

Unlike AnyRequest, there is no era split here and no variant that stands for “the draft has no stream for this”. Every draft from 07 on carries subgroup objects on a unidirectional stream of their own, and this is the first part of the facade that spans all fourteen without a footnote. The walls that stop the control plane at draft-11 — no ANNOUNCE, no TRACK_STATUS_REQUEST, a request ceiling granted by a message this crate cannot send — are all about requests, and none of them touches a data stream.

Variants§

§

Draft07(FramedSendStream)

Draft-07’s subgroup stream.

§

Draft08(FramedSendStream)

Draft-08’s subgroup stream.

§

Draft09(FramedSendStream)

Draft-09’s subgroup stream.

§

Draft10(FramedSendStream)

Draft-10’s subgroup stream.

§

Draft11(FramedSendStream)

Draft-11’s subgroup stream.

§

Draft12(FramedSendStream)

Draft-12’s subgroup stream.

§

Draft13(FramedSendStream)

Draft-13’s subgroup stream.

§

Draft14(FramedSendStream)

Draft-14’s subgroup stream.

§

Draft15(FramedSendStream)

Draft-15’s subgroup stream.

§

Draft16(FramedSendStream)

Draft-16’s subgroup stream.

§

Draft17(FramedSendStream)

Draft-17’s subgroup stream.

§

Draft18(FramedSendStream)

Draft-18’s subgroup stream.

§

Draft19(FramedSendStream)

Draft-19’s subgroup stream.

§

Draft20(FramedSendStream)

Draft-20’s subgroup stream.

§

Draft21(FramedSendStream)

Draft-21’s subgroup stream.

Implementations§

Source§

impl AnySubgroupWriter

Source

pub fn draft(&self) -> DraftVersion

The draft framing this stream.

Source

pub fn stream_id(&self) -> u64

Which stream this subgroup is being written on.

Bare rather than an Option, unlike AnyRequest::stream_id: a subgroup stream is a stream on every draft, so there is no era for the option to describe.

The number is the transport’s own, and it is quinn’s StreamId::index() — the stream’s ordinal within its (initiator, directionality) class rather than the QUIC stream number. So the first unidirectional stream this side opens reports 0 whatever else is open, and a number from here identifies a stream only alongside who opened it and which way it runs. That is what AnyRequest::stream_id reports too, where all the streams being compared are of one class and the ordinal separates them cleanly.

Source

pub async fn write_object( &mut self, object_id: u64, payload: &[u8], ) -> Result<(), AnyConnectionError>

Append one object carrying payload under object_id.

§What this fills in, and why none of it is an argument

The declared payload length is payload.len(), always. Drafts 15 and later store it as a field of the object and refuse an object whose field disagrees with the bytes beside it — the length is already on the wire ahead of the payload, so a disagreement produces a frame no reader can parse and no writer can repair. Drafts 07 through 14 overwrite the field for the same reason. A caller has no way to want a third answer.

The status is Normal when the payload is empty and absent when it is not, which is the only pair the wire can express: the status field and the payload occupy the same position. An object with bytes and a non-Normal status is asking for two framings at once, and the per-draft writers refuse it. Sending a real status — END_OF_GROUP, END_OF_TRACK — is a different call with different rules about where on the track it may appear, and is reached through the draft’s own Connection rather than invented here.

The extension block is empty, and whether one is written at all was settled by the header AnyConnection::open_subgroup put on the stream. That is not this method’s to change: an object that guessed differently from its header would misframe every object after it.

Source

pub async fn finish(&mut self) -> Result<(), AnyConnectionError>

Close the stream, which ends the subgroup.

A subgroup has no terminator message on any draft: the stream ending is the end of it. So this is not a courtesy — a reader on the far side is waiting for either another object or the end, and cannot tell which is coming until one of them arrives.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more