#![doc(html_root_url = "https://docs.rs/serve-net")]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![forbid(unsafe_code)]
#![deny(missing_docs)]
#![cfg_attr(not(feature = "http1"), allow(dead_code))]
mod client;
mod config;
mod conn;
pub mod engine;
mod envelope;
mod error;
mod forwarded;
mod health;
mod hooks;
#[cfg(feature = "http1")]
mod http;
#[cfg(all(serve_net_loom, test, feature = "http1"))]
mod loom_tests;
mod net;
mod notify;
mod reload;
mod reply;
mod running;
mod server;
mod service;
mod snapshot;
mod stats;
mod sync;
#[cfg(feature = "http1")]
pub mod testing;
#[cfg(feature = "ws")]
mod ws;
pub use client::{ClientInfo, IngressKind, Scheme};
pub use config::{
Budget, EngineChoice, ForwardedSource, Ingress, KeepAlive, Limits, ListenerSource,
ListenerSpec, MissingHeader, Profile, ProfileId, ProfileTable, ProxySource, UnixMode,
UnixPeerTrust, UnknownClient, Workers,
};
pub use envelope::{Envelope, RequestSeq};
pub use error::{ConfigError, ConfigErrors, ConfigWarning, EndReason, RuleId, ServeError, Subject};
pub use health::{Health, HealthIssue, ListenerInfo, ListenerState};
pub use hooks::{
Admit, Admitted, Checkpoint, CheckpointAt, DefaultHooks, Dispatch, HookSet, Hooks, InFlightCap,
Inline, NoCheckpoint, NoObserver, Observer, Offload, OffloadJob, OffloadPool, Shed, Verdict,
};
#[cfg(feature = "http1")]
pub use http::{
DetachedHead, Fields, Handler, HttpBody, HttpFamily, HttpHead, HttpParts, HttpReply,
HttpRequest, HttpService, ReplyStream, handler, http, http_behind_proxy,
};
#[cfg(feature = "http1")]
pub use http_net::{Method, Version};
pub use net::{
AddrError, AllowAll, Cidr, CloseReason, ConnectionId, ControlLine, ControlState, DriverKind,
EventSink, Gate, GateTag, Lane, NoControl, NoopSink, ProxyVersions, SimpleControl,
TrustedProxies, WorkerId,
};
pub use notify::{NoNotify, Notify, SystemdNotify, WatchdogPinger};
pub use reload::{ReloadSummary, ServerConfig};
pub use reply::{CompleteError, Reply, ReplyToken};
pub use running::{Bound, DrainHandle, DrainReport, Running};
pub use server::{Built, Server, ServerBuilder};
pub use service::{
BodyPolicy, Finished, HeadAction, Outcome, RequestEnd, UpgradeTarget, UpgradedConn, WorkClass,
};
pub use snapshot::{Snapshot, SnapshotReader};
pub use stats::Stats;
#[cfg(feature = "ws")]
pub use ws::{WebSocketConn, WebSocketService, WebSocketTarget, WsMessage, WsSendError, WsSender};
#[cfg(feature = "http1")]
pub use http_net;
pub use net_io;
#[cfg(feature = "ws")]
pub use ws_net;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
#[cfg(test)]
mod tests {
use super::VERSION;
#[test]
fn test_version_matches_manifest_three_parts() {
assert_eq!(VERSION, env!("CARGO_PKG_VERSION"));
assert_eq!(VERSION.split('.').count(), 3, "expected MAJOR.MINOR.PATCH");
}
}