QPACK: display header field in qif line format
use std::borrow::Cow;
+use std::fmt::{Display, Formatter};
/**
* https://tools.ietf.org/html/rfc7541
@@ -39,6 +40,18 @@ impl HeaderField {
}
}
+impl Display for HeaderField {
+ fn fmt(&self, f: &mut Formatter) -> Result<(), std::fmt::Error> {
+ write!(
+ f,
+ "{}\t{}",
+ String::from_utf8_lossy(&self.name),
+ String::from_utf8_lossy(&self.value)
+ )?;
+ Ok(())
+ }
+}
+
#[cfg(test)]
mod tests {
use super::*;
