Cargo Features

[dependencies]
saphir = { version = "3.1.1", default-features = false, features = ["full", "post-redirect", "redirect", "https", "json", "form", "macro", "multipart", "file", "operation", "http1", "http2", "validate-requests", "tracing-instrument"] }
default = http1, macro

These default features are set whenever saphir is added without default-features = false somewhere in the dependency tree.

full = file, form, http1, http2, https, json, macro, multipart, operation, post-redirect
post-redirect full? = json, redirect
redirect post-redirect? = form, mime

Affects saphir::redirect

https full? = base64, rustls, rustls-pemfile, tokio-rustls

Affects server::SslConfig, server::ListenerConfig

json full? post-redirect? = serde, serde_json

Affects body::json

form full? redirect? = serde, serde_urlencoded

Affects body::form, utils::read_query_string_to_hashmap, utils::read_query_string_to_type

macro default full? = saphir_macro

Affects saphir::macros

multipart full? = mime, multer

Affects saphir::multipart

file full? = brotli, flate2, mime, mime_guess, percent-encoding, time

Enables fs of tokio

macros only in dev deps

Affects saphir::file

operation full? = serde, uuid

Affects http_context::OPERATION_ID_HEADER, http_context::HttpContext.operation_id, http_context::operation

http1 default full?

Enables http1 of hyper ^0.14

hyper:

HTTP versions

http2 full?

Enables http2 of hyper ^0.14

validate-requests = validator

Enables validate-requests of saphir_macro

tracing-instrument = tracing

Enables tracing-instrument of saphir_macro

Affects responder::spanned

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features.

uuid operation?
rustls https?

Enables rustls ^0.21

rustls-pemfile https?

Enables rustls-pemfile ^1.0

tracing tracing-instrument?
tokio-rustls https?

Enables tokio-rustls ^0.24

base64 https?
serde form? json? operation?
serde_json json?
serde_urlencoded form?
saphir_macro macro tracing-instrument? validate-requests?
mime file? multipart? redirect?
multer multipart?

Enables multer ^2.0

mime_guess file?
percent-encoding file?
time file?
flate2 file?
brotli file?
validator validate-requests?