Last active
July 24, 2020 12:01
-
-
Save yoshuawuyts/4442350ff32d1f3c7f28ef0e3311bfac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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