pub struct DeployConfig {Show 17 fields
pub version: u32,
pub index: Vec<String>,
pub clean_urls: bool,
pub case_insensitive: bool,
pub trailing_slash: TrailingSlash,
pub error_documents: BTreeMap<u16, String>,
pub redirects: Vec<Redirect>,
pub rewrites: Vec<Rewrite>,
pub headers: Vec<HeaderRule>,
pub cache: CacheConfig,
pub mime_overrides: BTreeMap<String, String>,
pub proxy_allow: Vec<String>,
pub handlers: Vec<HandlerConfig>,
pub consumers: Vec<ConsumerConfig>,
pub crons: Vec<CronConfig>,
pub streams: Vec<StreamConfig>,
pub sessions: Vec<SessionConfig>,
}Expand description
Deploy-scoped configuration — the routing section of project.cfg.
Fields§
§version: u32Schema version, pinned at crate::SCHEMA_VERSION. Optional in
project.cfg routing (defaults to 1); always present once folded in.
index: Vec<String>Directory-index candidates, tried in order (default ["index.html"]).
clean_urls: boolMap extensionless URLs to .html files (/about → /about.html).
case_insensitive: boolMatch the request path case-insensitively against redirects, rewrites,
and static files (/About.HTML serves /about.html). Off by default
(paths are case-sensitive); opt-in for case-folding origins.
trailing_slash: TrailingSlashTrailing-slash policy.
error_documents: BTreeMap<u16, String>Status code → error document (e.g. 404 → /404.html).
redirects: Vec<Redirect>Redirect rules (first match wins).
rewrites: Vec<Rewrite>Rewrite rules (internal rewrite or proxy; first match wins).
headers: Vec<HeaderRule>Response-header rules (all matching rules apply, in order).
cache: CacheConfigCache-Control defaults.
mime_overrides: BTreeMap<String, String>Extension → MIME overrides (e.g. .webmanifest).
proxy_allow: Vec<String>Allowed upstream hosts for proxy rewrites (exact host or .suffix
match). When empty, proxying to any public host is allowed; private,
loopback, link-local, and similar internal addresses are always blocked
(SSRF guard), regardless of this list.
handlers: Vec<HandlerConfig>WebAssembly request handlers (deploy-scoped). Matched before static lookup, after redirects.
consumers: Vec<ConsumerConfig>Message-consumer components, invoked per message on a topic.
crons: Vec<CronConfig>Scheduled handler invocations (cron).
streams: Vec<StreamConfig>Host-level SSE endpoints fanning out messaging topics.
sessions: Vec<SessionConfig>Duplex/resumable session routes (PLAN-session-primitive): a guest session-handler the
host re-enters per inbound frame, with host-owned ordering/resume/lifetime.
Implementations§
Source§impl DeployConfig
impl DeployConfig
Sourcepub fn from_ron(text: &str) -> Result<DeployConfig, ConfigError>
pub fn from_ron(text: &str) -> Result<DeployConfig, ConfigError>
Parse a deploy-scoped routing document (RON). implicit_some is enabled
so optional fields can be written as bare values (not Some("...")).
Sourcepub fn proxy_host_allowed(&self, host: &str) -> bool
pub fn proxy_host_allowed(&self, host: &str) -> bool
Whether host is permitted as a proxy-rewrite upstream by the
proxy_allow list. An empty list permits any host (the separate
public-IP SSRF guard still applies); otherwise the host must equal an
entry or be a subdomain of a .-prefixed suffix entry.
Sourcepub fn compile_check(&self) -> Result<(), ConfigError>
pub fn compile_check(&self) -> Result<(), ConfigError>
Verify every route/header pattern compiles. Used by from_ron and the
validate subcommand so bad patterns fail fast at deploy time.
Trait Implementations§
Source§impl Clone for DeployConfig
impl Clone for DeployConfig
Source§fn clone(&self) -> DeployConfig
fn clone(&self) -> DeployConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeployConfig
impl Debug for DeployConfig
Source§impl Default for DeployConfig
impl Default for DeployConfig
Source§fn default() -> DeployConfig
fn default() -> DeployConfig
Source§impl<'de> Deserialize<'de> for DeployConfigwhere
DeployConfig: Default,
impl<'de> Deserialize<'de> for DeployConfigwhere
DeployConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DeployConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DeployConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for DeployConfig
Source§impl PartialEq for DeployConfig
impl PartialEq for DeployConfig
Source§impl Serialize for DeployConfig
impl Serialize for DeployConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for DeployConfig
Auto Trait Implementations§
impl Freeze for DeployConfig
impl RefUnwindSafe for DeployConfig
impl Send for DeployConfig
impl Sync for DeployConfig
impl Unpin for DeployConfig
impl UnsafeUnpin for DeployConfig
impl UnwindSafe for DeployConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.