ハイパー クレートからimpl_headerマクロを使用してカスタム HTTP ヘッダーを実装しようとしていますが、hyper::header
モジュールを解決できないようです。
これが私のコードです:
#[macro_use] extern crate hyper;
use hyper::header;
struct CustomHeader;
impl_header!(CustomHeader, "value", String);
そして、ここにコンパイラエラーがあります:
<hyper macros>:11:14: 11:20 error: unresolved import `header::HeaderFormat`. Maybe a missing `extern crate header`?
<hyper macros>:11 Result { use header:: HeaderFormat ; self . fmt_header ( f ) } } }
^~~~~~
<hyper macros>:1:1: 11:67 note: in expansion of impl_header!
lib.rs:4:1: 4:45 note: expansion site
error: aborting due to previous error
Could not compile `macro_issue`.
なぜこれが起こるのか、どうすれば修正できますか?
ありがとうございました