mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-19 09:45:20 +00:00
QPACK: display header field in qif line format
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
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::*;
|
||||
|
||||
Reference in New Issue
Block a user