Skip to content

Instantly share code, notes, and snippets.

@yoshuawuyts
Last active July 24, 2020 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoshuawuyts/4442350ff32d1f3c7f28ef0e3311bfac to your computer and use it in GitHub Desktop.
Save yoshuawuyts/4442350ff32d1f3c7f28ef0e3311bfac to your computer and use it in GitHub Desktop.
use crate::headers::{HeaderName, HeaderValue, Headers, ToHeaderValues};
struct CustomHeader {}
impl CustomHeader {
/// Create a new instance of `CustomHeader`.
fn new() -> Self {
todo!();
}
/// Create an instance of `CustomHeader` from a `Headers` instance.
fn from_headers(headers: impl AsRef<Headers>) -> crate::Result<Option<Self>> {
todo!();
}
/// Insert a `HeaderName` + `HeaderValue` pair into a `Headers` instance.
fn apply(&self, headers: impl AsMut<Headers>) {
todo!();
}
/// Get the `HeaderName`.
fn name(&self) -> HeaderName {
todo!();
}
/// Get the `HeaderValue`.
fn value(&self) -> HeaderValue {
todo!();
}
}
// Conversion from `CustomHeader` -> `HeaderValue`.
impl ToHeaderValues for CustomHeader {
type Iter;
fn to_header_values(&self) -> crate::Result<Self::Iter> {
todo!()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment