/// The local control stream, responsible for encoding frames and sending them #[derive(Debug)] pubstruct ControlStreamLocal {
stream: BufferedStream, /// `stream_id`s of outstanding request streams
outstanding_priority_update: VecDeque<StreamId>,
}
/// Add a new frame that needs to be send. pubfn queue_frame(&mutself, f: &HFrame) { letmut enc = Encoder::default();
f.encode(&mut enc); self.stream.buffer(enc.as_ref());
}
// can assert and unwrap here, because priority updates can only be added to // HttpStreams in [Http3Connection::queue_update_priority}
debug_assert!(matches!(
update_stream.stream_type(),
Http3StreamType::Http | Http3StreamType::Push
)); let stream = update_stream.http_stream().unwrap();
// in case multiple priority_updates were issued, ignore now irrelevant iflet Some(hframe) = stream.priority_update_frame() { letmut enc = Encoder::new();
hframe.encode(&mut enc); ifself.stream.send_atomic(conn, enc.as_ref())? {
stream.priority_update_sent();
} else { self.outstanding_priority_update.push_front(update_id); break;
}
}
}
Ok(())
}
/// Create a control stream. pubfn create(&mutself, conn: &mut Connection) -> Res<()> {
qtrace!([self], "Create a control stream."); self.stream.init(conn.stream_create(StreamType::UniDi)?); self.stream
.buffer(&[u8::try_from(HTTP3_UNI_STREAM_TYPE_CONTROL).unwrap()]);
Ok(())
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.