| 487 | |
| 488 | template <typename T> |
| 489 | Result<T> get() const |
| 490 | { |
| 491 | Option<std::string> value = get(T::NAME); |
| 492 | if (value.isNone()) { |
| 493 | return None(); |
| 494 | } |
| 495 | Try<T> header = T::create(value.get()); |
| 496 | if (header.isError()) { |
| 497 | return Error(header.error()); |
| 498 | } |
| 499 | return header.get(); |
| 500 | } |
| 501 | |
| 502 | Option<std::string> get(const std::string& key) const |
| 503 | { |