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
impl AnySubgroupWriter
Sourcepub fn draft(&self) -> DraftVersion
pub fn draft(&self) -> DraftVersion
The draft framing this stream.
Sourcepub fn stream_id(&self) -> u64
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.
Sourcepub async fn write_object(
&mut self,
object_id: u64,
payload: &[u8],
) -> Result<(), AnyConnectionError>
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.
Sourcepub async fn finish(&mut self) -> Result<(), AnyConnectionError>
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.