Skip to main content

DeployConfig

Struct DeployConfig 

Source
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: u32

Schema 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: bool

Map extensionless URLs to .html files (/about/about.html).

§case_insensitive: bool

Match 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: TrailingSlash

Trailing-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: CacheConfig

Cache-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

Source

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("...")).

Source

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.

Source

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

Source§

fn clone(&self) -> DeployConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeployConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for DeployConfig

Source§

fn default() -> DeployConfig

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for DeployConfig

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<DeployConfig, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for DeployConfig

Source§

impl PartialEq for DeployConfig

Source§

fn eq(&self, other: &DeployConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for DeployConfig

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DeployConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more