}
//a cursor turning EOF into blocking errors
+#[derive(Debug)]
pub struct HTTP2cursor {
pub cursor: Cursor<Vec<u8>>,
}
BROTLI(brotli::Decompressor<HTTP2cursor>),
}
+impl std::fmt::Debug for HTTP2Decompresser {
+ fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+ match self {
+ HTTP2Decompresser::UNASSIGNED => write!(f, "UNASSIGNED"),
+ HTTP2Decompresser::GZIP(_) => write!(f, "GZIP"),
+ HTTP2Decompresser::BROTLI(_) => write!(f, "BROTLI"),
+ }
+ }
+}
+impl std::fmt::Display for HTTP2Decompresser {
+ fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+ match self {
+ HTTP2Decompresser::UNASSIGNED => write!(f, "UNASSIGNED"),
+ HTTP2Decompresser::GZIP(_) => write!(f, "GZIP"),
+ HTTP2Decompresser::BROTLI(_) => write!(f, "BROTLI"),
+ }
+ }
+}
+
+#[derive(Debug)]
struct HTTP2DecoderHalf {
encoding: HTTP2ContentEncoding,
decoder: HTTP2Decompresser,
}
}
+#[derive(Debug)]
pub struct HTTP2Decoder {
decoder_tc: HTTP2DecoderHalf,
decoder_ts: HTTP2DecoderHalf,
pub reason: HTTP2FrameUnhandledReason,
}
+#[derive(Debug)]
pub enum HTTP2FrameTypeData {
PRIORITY(parser::HTTP2FramePriority),
GOAWAY(parser::HTTP2FrameGoAway),
HTTP2StateGlobal = 8,
}
+#[derive(Debug)]
pub struct HTTP2Frame {
pub header: parser::HTTP2FrameHeader,
pub data: HTTP2FrameTypeData,
}
+#[derive(Debug)]
pub struct HTTP2Transaction {
tx_id: u64,
pub stream_id: u32,
use std;
use std::collections::HashMap;
-#[derive(Hash, PartialEq, Eq)]
+#[derive(Hash, PartialEq, Eq, Debug)]
enum HeaderName {
Method,
Path,
}
}
-#[derive(PartialEq)]
+#[derive(PartialEq, Debug)]
pub struct HTTP2FrameHeader {
//we could add detection on (GOAWAY) additional data
pub length: u32,
}
}
-#[derive(Clone, Copy)]
+#[derive(Clone, Copy, Debug)]
pub struct HTTP2FrameGoAway {
pub errorcode: u32, //HTTP2ErrorCode
}
)
);
-#[derive(Clone, Copy)]
+#[derive(Clone, Copy, Debug)]
pub struct HTTP2FrameRstStream {
pub errorcode: u32, ////HTTP2ErrorCode
}
)
);
-#[derive(Clone, Copy)]
+#[derive(Clone, Copy, Debug)]
pub struct HTTP2FramePriority {
pub exclusive: u8,
pub dependency: u32,
)
);
-#[derive(Clone, Copy)]
+#[derive(Clone, Copy, Debug)]
pub struct HTTP2FrameWindowUpdate {
pub reserved: u8,
pub sizeinc: u32,
)
);
-#[derive(Clone, Copy)]
+#[derive(Clone, Copy, Debug)]
pub struct HTTP2FrameHeadersPriority {
pub exclusive: u8,
pub dependency: u32,
}
}
-#[derive(Clone)]
+#[derive(Clone, Debug)]
pub struct HTTP2FrameHeaders {
pub padlength: Option<u8>,
pub priority: Option<HTTP2FrameHeadersPriority>,
));
}
-#[derive(Clone)]
+#[derive(Clone, Debug)]
pub struct HTTP2FramePushPromise {
pub padlength: Option<u8>,
pub reserved: u8,
));
}
-#[derive(Clone)]
+#[derive(Clone, Debug)]
pub struct HTTP2FrameContinuation {
pub blocks: Vec<HTTP2FrameHeaderBlock>,
}
)
);
-#[derive(Clone, Copy)]
+#[derive(Clone, Copy, Debug)]
pub struct HTTP2FrameSettings {
pub id: HTTP2SettingsId,
pub value: u32,