【问题标题】:Is there a way I can access a macro from a dependency's dependency without explicitly including it?有没有一种方法可以从依赖项的依赖项中访问宏而不显式包含它?
【发布时间】:2018-08-22 01:48:10
【问题描述】:

Reqwest 构建在 Hyper 之上,其中包含一个 header! 宏来创建自定义标头。有没有一种方法可以访问 header! 宏,而无需明确将 Hyper 作为单独的 crate 包含在内?

#[macro_use] extern crate reqwest;

header! { (XRequestGuid, "X-Request-Guid") => [String] }

在此范围内找不到宏 header!

【问题讨论】:

    标签: macros rust reqwest


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 2014-04-04
    • 1970-01-01
    • 2023-03-30
    • 1970-01-01
    • 1970-01-01
    • 2014-08-20
    • 2017-08-03
    相关资源
    最近更新 更多