headers-core-0.2.0/Cargo.toml.orig010066400017500001750000000006031357452157100151750ustar0000000000000000[package] name = "headers-core" version = "0.2.0" # don't forget to update html_root_url description = "typed HTTP headers core trait" license = "MIT" readme = "README.md" homepage = "https://hyper.rs" repository = "https://github.com/hyperium/headers" authors = ["Sean McArthur "] keywords = ["http", "headers", "hyper", "hyperium"] [dependencies] http = "0.2.0" headers-core-0.2.0/Cargo.toml0000644000000015601357452202700115010ustar00# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] name = "headers-core" version = "0.2.0" authors = ["Sean McArthur "] description = "typed HTTP headers core trait" homepage = "https://hyper.rs" readme = "README.md" keywords = ["http", "headers", "hyper", "hyperium"] license = "MIT" repository = "https://github.com/hyperium/headers" [dependencies.http] version = "0.2.0" headers-core-0.2.0/LICENSE010066400017500001750000000020471342265275000133130ustar0000000000000000Copyright (c) 2014-2019 Sean McArthur Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. headers-core-0.2.0/README.md010066400017500001750000000000571342265366500135720ustar0000000000000000# Typed HTTP Headers: core `Header` trait WIP headers-core-0.2.0/src/lib.rs010066400017500001750000000033271357452161600142170ustar0000000000000000#![deny(missing_docs)] #![deny(missing_debug_implementations)] #![cfg_attr(test, deny(warnings))] #![doc(html_root_url = "https://docs.rs/headers-core/0.2.0")] //! # headers-core //! //! This is the core crate of the typed HTTP headers system, providing only //! the relevant traits. All actual header implementations are in other crates. extern crate http; pub use http::header::{self, HeaderName, HeaderValue}; use std::error; use std::fmt::{self, Display, Formatter}; /// A trait for any object that will represent a header field and value. /// /// This trait represents the construction and identification of headers, /// and contains trait-object unsafe methods. pub trait Header { /// The name of this header. fn name() -> &'static HeaderName; /// Decode this type from an iterator of `HeaderValue`s. fn decode<'i, I>(values: &mut I) -> Result where Self: Sized, I: Iterator; /// Encode this type to a `HeaderMap`. /// /// This function should be infallible. Any errors converting to a /// `HeaderValue` should have been caught when parsing or constructing /// this value. fn encode>(&self, values: &mut E); } /// Errors trying to decode a header. #[derive(Debug)] pub struct Error { kind: Kind, } #[derive(Debug)] enum Kind { Invalid, } impl Error { /// Create an 'invalid' Error. pub fn invalid() -> Error { Error { kind: Kind::Invalid, } } } impl Display for Error { fn fmt(&self, f: &mut Formatter) -> fmt::Result { match &self.kind { Kind::Invalid => f.write_str("invalid HTTP header"), } } } impl error::Error for Error {} headers-core-0.2.0/.cargo_vcs_info.json0000644000000001121357452202700134730ustar00{ "git": { "sha1": "ee0414d18183d1b5ed84b397cfdcf6b49476dfc0" } }