//! # 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.
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. pubtrait 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<Self, Error> where Self: Sized,
I: Iterator<Item = &'i HeaderValue>;
/// 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<E: Extend<HeaderValue>>(&self, values: &mut E);
}
/// Errors trying to decode a header. #[derive(Debug)] pubstruct Error {
kind: Kind,
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.