#![doc(html_root_url = "https://docs.rs/parse-net")]
#![no_std]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![forbid(unsafe_code)]
#![deny(missing_docs)]
#![deny(unused_must_use, unused_results)]
#![cfg_attr(
not(test),
deny(
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
clippy::todo,
clippy::unimplemented,
clippy::unreachable,
clippy::dbg_macro,
clippy::print_stdout,
clippy::print_stderr,
clippy::indexing_slicing
)
)]
#[cfg(any(feature = "std", test))]
extern crate std;
#[cfg(feature = "alloc")]
extern crate alloc;
pub mod auth;
pub mod cache;
pub mod class;
pub mod date;
pub mod disposition;
mod error;
pub mod etag;
pub mod ext_value;
pub mod forwarded;
pub mod host;
mod limits;
pub mod link;
pub mod list;
pub mod mail;
pub mod media;
pub mod negotiate;
pub mod num;
pub mod origin;
#[cfg(feature = "alloc")]
mod owned;
pub mod param;
pub mod pct;
pub mod range;
pub mod scan;
pub mod sfv;
pub mod text;
mod utf8;
pub mod write;
pub use auth::{AuthPayload, Challenge, Credentials, basic, bearer};
pub use cache::{
Directive, RequestDirectives, ResponseDirectives, request_cache_control, response_cache_control,
};
#[cfg(feature = "std")]
pub use date::http_date;
pub use date::{Civil, DateFormat, HttpDate, MailDate, http_date_at};
pub use disposition::{
ContentDisposition, DispositionType, Filename, parse_content_disposition, write_attachment,
};
pub use error::{ErrorKind, Full, ParseError, WriteError};
pub use etag::{Condition, EntityTag, TagList, if_match, if_none_match, parse_condition};
pub use ext_value::{Charset, ExtValue, write_ext_value};
pub use forwarded::{ClientAddress, ForwardedSource, Trust, client_address};
pub use host::{Host, HostPort, parse_host_port};
pub use limits::{DuplicatePolicy, Limits};
pub use link::{LinkValue, Links, parse_link};
pub use list::{List, list};
pub use media::{Boundary, MediaRange, MediaType, parse_media_type};
pub use negotiate::{QValue, best_charset, best_encoding, best_language, best_media};
pub use origin::{Origin, OriginValue, parse_origin};
#[cfg(feature = "alloc")]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
pub use owned::{OwnedEntityTag, OwnedHostPort, OwnedMediaType};
pub use param::{Param, Params};
pub use range::{
ByteRange, ContentRange, IfRange, RangeHeader, RangeOutcome, RangeSpec, byte_ranges,
};
pub use text::{Comment, Quoted, Word};
pub use write::{CountSink, Sink, SliceSink};
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
#[cfg(test)]
mod tests {
use super::VERSION;
#[test]
fn test_version_matches_manifest() {
assert_eq!(VERSION, env!("CARGO_PKG_VERSION"));
assert_eq!(VERSION.split('.').count(), 3, "expected MAJOR.MINOR.PATCH");
}
}