Skip to content

Commit 89229f8

Browse files
committed
format
1 parent d87cf27 commit 89229f8

11 files changed

Lines changed: 129 additions & 142 deletions

File tree

‎qlog/src/events/http/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pub mod h3;
1+
pub mod h3;

‎qlog/src/events/mod.rs‎

Lines changed: 25 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626

2727
use crate::Bytes;
2828
use crate::Token;
29-
use http::h3::*;
3029
use http::h3;
30+
use http::h3::*;
3131
use quic::connectivity;
3232
use quic::connectivity::*;
3333
use quic::quic::*;
34-
use quic::recovery::*;
3534
use quic::recovery;
35+
use quic::recovery::*;
3636
use quic::security;
3737

3838
use serde::Deserialize;
@@ -44,7 +44,8 @@ pub type ExData = BTreeMap<String, serde_json::Value>;
4444

4545
pub const LOGLEVEL_URI: &str = "urn:ietf:params:qlog:events:gen#loglevel-09";
4646

47-
pub const CONNECTIVITY_URI: &str = "urn:ietf:params:qlog:events:quic#connectivity-08";
47+
pub const CONNECTIVITY_URI: &str =
48+
"urn:ietf:params:qlog:events:quic#connectivity-08";
4849
pub const SECURITY_URI: &str = "urn:ietf:params:qlog:events:quic#security-08";
4950
pub const QUIC_URI: &str = "urn:ietf:params:qlog:events:quic#quic-08";
5051
pub const RECOVERY_URI: &str = "urn:ietf:params:qlog:events:quic#recovery-08";
@@ -236,25 +237,20 @@ impl From<EventType> for EventImportance {
236237
EventType::SecurityEventType(SecurityEventType::KeyDiscarded) =>
237238
EventImportance::Base,
238239

239-
EventType::QuicEventType(
240-
QuicEventType::VersionInformation,
241-
) => EventImportance::Core,
242-
EventType::QuicEventType(
243-
QuicEventType::AlpnInformation,
244-
) => EventImportance::Core,
240+
EventType::QuicEventType(QuicEventType::VersionInformation) =>
241+
EventImportance::Core,
242+
EventType::QuicEventType(QuicEventType::AlpnInformation) =>
243+
EventImportance::Core,
245244
EventType::QuicEventType(QuicEventType::ParametersSet) =>
246245
EventImportance::Core,
247-
EventType::QuicEventType(
248-
QuicEventType::ParametersRestored,
249-
) => EventImportance::Base,
250-
EventType::QuicEventType(
251-
QuicEventType::UdpDatagramsReceived,
252-
) => EventImportance::Extra,
246+
EventType::QuicEventType(QuicEventType::ParametersRestored) =>
247+
EventImportance::Base,
248+
EventType::QuicEventType(QuicEventType::UdpDatagramsReceived) =>
249+
EventImportance::Extra,
253250
EventType::QuicEventType(QuicEventType::UdpDatagramsSent) =>
254251
EventImportance::Extra,
255-
EventType::QuicEventType(
256-
QuicEventType::UdpDatagramDropped,
257-
) => EventImportance::Extra,
252+
EventType::QuicEventType(QuicEventType::UdpDatagramDropped) =>
253+
EventImportance::Extra,
258254
EventType::QuicEventType(QuicEventType::PacketReceived) =>
259255
EventImportance::Core,
260256
EventType::QuicEventType(QuicEventType::PacketSent) =>
@@ -265,12 +261,10 @@ impl From<EventType> for EventImportance {
265261
EventImportance::Base,
266262
EventType::QuicEventType(QuicEventType::PacketsAcked) =>
267263
EventImportance::Extra,
268-
EventType::QuicEventType(
269-
QuicEventType::StreamStateUpdated,
270-
) => EventImportance::Base,
271-
EventType::QuicEventType(
272-
QuicEventType::FramesProcessed,
273-
) => EventImportance::Extra,
264+
EventType::QuicEventType(QuicEventType::StreamStateUpdated) =>
265+
EventImportance::Base,
266+
EventType::QuicEventType(QuicEventType::FramesProcessed) =>
267+
EventImportance::Extra,
274268
EventType::QuicEventType(QuicEventType::StreamDataMoved) =>
275269
EventImportance::Base,
276270
EventType::QuicEventType(QuicEventType::DatagramDataMoved) =>
@@ -396,7 +390,7 @@ impl From<&EventData> for EventType {
396390
),
397391
EventData::PathAssigned { .. } => EventType::ConnectivityEventType(
398392
ConnectivityEventType::PathAssigned,
399-
),
393+
),
400394
EventData::MtuUpdated { .. } => EventType::ConnectivityEventType(
401395
ConnectivityEventType::MtuUpdated,
402396
),
@@ -407,20 +401,15 @@ impl From<&EventData> for EventType {
407401
EventType::SecurityEventType(SecurityEventType::KeyDiscarded),
408402

409403
EventData::VersionInformation { .. } =>
410-
EventType::QuicEventType(
411-
QuicEventType::VersionInformation,
412-
),
404+
EventType::QuicEventType(QuicEventType::VersionInformation),
413405
EventData::AlpnInformation { .. } =>
414406
EventType::QuicEventType(QuicEventType::AlpnInformation),
415407
EventData::ParametersSet { .. } =>
416408
EventType::QuicEventType(QuicEventType::ParametersSet),
417409
EventData::ParametersRestored { .. } =>
418-
EventType::QuicEventType(
419-
QuicEventType::ParametersRestored,
420-
),
421-
EventData::UdpDatagramsReceived { .. } => EventType::QuicEventType(
422-
QuicEventType::UdpDatagramsReceived,
423-
),
410+
EventType::QuicEventType(QuicEventType::ParametersRestored),
411+
EventData::UdpDatagramsReceived { .. } =>
412+
EventType::QuicEventType(QuicEventType::UdpDatagramsReceived),
424413
EventData::UdpDatagramsSent { .. } =>
425414
EventType::QuicEventType(QuicEventType::UdpDatagramsSent),
426415
EventData::UdpDatagramDropped { .. } =>
@@ -436,9 +425,7 @@ impl From<&EventData> for EventType {
436425
EventData::PacketsAcked { .. } =>
437426
EventType::QuicEventType(QuicEventType::PacketsAcked),
438427
EventData::StreamStateUpdated { .. } =>
439-
EventType::QuicEventType(
440-
QuicEventType::StreamStateUpdated,
441-
),
428+
EventType::QuicEventType(QuicEventType::StreamStateUpdated),
442429
EventData::FramesProcessed { .. } =>
443430
EventType::QuicEventType(QuicEventType::FramesProcessed),
444431
EventData::StreamDataMoved { .. } =>
@@ -734,5 +721,5 @@ pub struct PathEndpointInfo {
734721
pub connection_ids: Vec<Bytes>,
735722
}
736723

724+
pub mod http;
737725
pub mod quic;
738-
pub mod http;

‎qlog/src/events/quic/connectivity.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,4 @@ pub struct MtuUpdated {
154154
pub old: Option<u32>,
155155
pub new: u32,
156156
pub done: Option<bool>,
157-
}
157+
}

‎qlog/src/events/quic/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl PacketHeader {
144144
}
145145
}
146146

147-
pub mod quic;
148147
pub mod connectivity;
148+
pub mod quic;
149149
pub mod recovery;
150150
pub mod security;

‎qlog/src/events/quic/quic.rs‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ use smallvec::SmallVec;
3131

3232
use super::connectivity::TransportOwner;
3333
use super::PacketHeader;
34-
use crate::Bytes;
3534
use crate::events::DataRecipient;
3635
use crate::events::PathEndpointInfo;
3736
use crate::events::RawInfo;
3837
use crate::events::Token;
38+
use crate::Bytes;
3939
use crate::StatelessResetToken;
4040

4141
#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, Debug)]
@@ -181,11 +181,6 @@ pub enum SecurityEventType {
181181
KeyDiscarded,
182182
}
183183

184-
185-
186-
187-
188-
189184
#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, Debug)]
190185
#[serde(untagged)]
191186
pub enum AckedRanges {
@@ -426,7 +421,7 @@ pub struct ParametersSet {
426421

427422
pub max_datagram_frame_size: Option<u64>,
428423

429-
pub grease_quic_bit: Option<bool>
424+
pub grease_quic_bit: Option<bool>,
430425
}
431426

432427
#[serde_with::skip_serializing_none]
@@ -489,7 +484,6 @@ pub struct PacketReceived {
489484
// `frames` is defined here in the QLog schema specification. However,
490485
// our streaming serializer requires serde to put the object at the end,
491486
// so we define it there and depend on serde's preserve_order feature.
492-
493487
pub stateless_reset_token: Option<StatelessResetToken>,
494488

495489
pub raw: Option<RawInfo>,
@@ -507,7 +501,6 @@ pub struct PacketSent {
507501
// `frames` is defined here in the QLog schema specification. However,
508502
// our streaming serializer requires serde to put the object at the end,
509503
// so we define it there and depend on serde's preserve_order feature.
510-
511504
pub stateless_reset_token: Option<StatelessResetToken>,
512505

513506
pub supported_versions: Option<Vec<Bytes>>,
@@ -631,8 +624,8 @@ pub struct MigrationStateUpdated {
631624
#[cfg(test)]
632625
mod tests {
633626

634-
use crate::testing::*;
635627
use crate::events::quic::PacketType;
628+
use crate::testing::*;
636629

637630
#[test]
638631
fn packet_header() {

‎qlog/src/events/quic/recovery.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,4 @@ pub struct PacketLost {
142142
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
143143
pub struct MarkedForRetransmit {
144144
pub frames: Vec<QuicFrame>,
145-
}
145+
}

‎qlog/src/lib.rs‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@
131131
//! data: None,
132132
//! };
133133
//!
134-
//! let event_data =
135-
//! qlog::events::EventData::PacketSent(qlog::events::quic::quic::PacketSent {
134+
//! let event_data = qlog::events::EventData::PacketSent(
135+
//! qlog::events::quic::quic::PacketSent {
136136
//! header: pkt_hdr,
137137
//! frames: Some(frames.into()),
138138
//! stateless_reset_token: None,
@@ -142,7 +142,8 @@
142142
//! is_mtu_probe_packet: None,
143143
//! send_at_time: None,
144144
//! trigger: None,
145-
//! });
145+
//! },
146+
//! );
146147
//!
147148
//! trace.push_event(qlog::events::Event::with_time(0.0, event_data));
148149
//! ```
@@ -336,8 +337,8 @@
336337
//! payload_length: 1234,
337338
//! };
338339
//!
339-
//! let event_data =
340-
//! qlog::events::EventData::PacketSent(qlog::events::quic::quic::PacketSent {
340+
//! let event_data = qlog::events::EventData::PacketSent(
341+
//! qlog::events::quic::quic::PacketSent {
341342
//! header: pkt_hdr,
342343
//! frames: Some(vec![ping, padding].into()),
343344
//! stateless_reset_token: None,
@@ -347,7 +348,8 @@
347348
//! is_mtu_probe_packet: None,
348349
//! send_at_time: None,
349350
//! trigger: None,
350-
//! });
351+
//! },
352+
//! );
351353
//!
352354
//! let event = qlog::events::Event::with_time(0.0, event_data);
353355
//!
@@ -717,8 +719,8 @@ pub mod testing {
717719
mod tests {
718720
use super::*;
719721
use crate::events::quic::quic::PacketSent;
720-
use crate::events::quic::PacketType;
721722
use crate::events::quic::quic::QuicFrame;
723+
use crate::events::quic::PacketType;
722724
use crate::events::EventData;
723725
use crate::events::RawInfo;
724726
use testing::*;

‎qlog/src/streamer.rs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,13 @@ impl QlogStreamer {
8686
title,
8787
description,
8888
trace,
89-
event_schemas: vec![CONNECTIVITY_URI.to_string(), SECURITY_URI.to_string(), QUIC_URI.to_string(), RECOVERY_URI.to_string(), H3_URI.to_string()]
89+
event_schemas: vec![
90+
CONNECTIVITY_URI.to_string(),
91+
SECURITY_URI.to_string(),
92+
QUIC_URI.to_string(),
93+
RECOVERY_URI.to_string(),
94+
H3_URI.to_string(),
95+
],
9096
};
9197

9298
QlogStreamer {

‎quiche/src/h3/frame.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ impl Frame {
433433
priority_field_value,
434434
} => Http3Frame::PriorityUpdate {
435435
target_stream_type:
436-
qlog::events::http::h3::PriorityTargetStreamType::Request,
436+
qlog::events::http::h3::PriorityTargetStreamType::Request,
437437
prioritized_element_id: *prioritized_element_id,
438438
priority_field_value: String::from_utf8_lossy(
439439
priority_field_value,

‎quiche/src/h3/mod.rs‎

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ use qlog::events::http::h3::FrameCreated;
295295
#[cfg(feature = "qlog")]
296296
use qlog::events::http::h3::FrameParsed;
297297
#[cfg(feature = "qlog")]
298+
use qlog::events::http::h3::Http3EventType;
299+
#[cfg(feature = "qlog")]
300+
use qlog::events::http::h3::Http3Frame;
301+
#[cfg(feature = "qlog")]
298302
use qlog::events::http::h3::Owner;
299303
#[cfg(feature = "qlog")]
300304
use qlog::events::http::h3::PriorityTargetStreamType;
@@ -303,10 +307,6 @@ use qlog::events::http::h3::StreamType;
303307
#[cfg(feature = "qlog")]
304308
use qlog::events::http::h3::StreamTypeSet;
305309
#[cfg(feature = "qlog")]
306-
use qlog::events::http::h3::Http3EventType;
307-
#[cfg(feature = "qlog")]
308-
use qlog::events::http::h3::Http3Frame;
309-
#[cfg(feature = "qlog")]
310310
use qlog::events::EventData;
311311
#[cfg(feature = "qlog")]
312312
use qlog::events::EventImportance;
@@ -2187,14 +2187,13 @@ impl Connection {
21872187
None
21882188
};
21892189

2190-
let ev_data =
2191-
EventData::H3StreamTypeSet(StreamTypeSet {
2192-
stream_id,
2193-
owner: Some(Owner::Remote),
2194-
stream_type: ty.to_qlog(),
2195-
stream_type_value: ty_val,
2196-
associated_push_id: None,
2197-
});
2190+
let ev_data = EventData::H3StreamTypeSet(StreamTypeSet {
2191+
stream_id,
2192+
owner: Some(Owner::Remote),
2193+
stream_type: ty.to_qlog(),
2194+
stream_type_value: ty_val,
2195+
associated_push_id: None,
2196+
});
21982197

21992198
q.add_event_data_now(ev_data).ok();
22002199
});
@@ -2350,13 +2349,12 @@ impl Connection {
23502349
qlog_with_type!(QLOG_FRAME_PARSED, conn.qlog, q, {
23512350
let frame = Http3Frame::Data { raw: None };
23522351

2353-
let ev_data =
2354-
EventData::H3FrameParsed(FrameParsed {
2355-
stream_id,
2356-
length: Some(payload_len),
2357-
frame,
2358-
raw: None,
2359-
});
2352+
let ev_data = EventData::H3FrameParsed(FrameParsed {
2353+
stream_id,
2354+
length: Some(payload_len),
2355+
frame,
2356+
raw: None,
2357+
});
23602358

23612359
q.add_event_data_now(ev_data).ok();
23622360
});

0 commit comments

Comments
 (0)