pub struct TemplateConfig {Show 22 fields
pub ffi: TemplateFfi,
pub idx: u8,
pub name: String,
pub mime: String,
pub minify: Option<bool>,
pub path: Option<String>,
pub route: String,
pub protected: Option<Check>,
pub cache: Option<TemplateCache>,
pub csp: Option<HttpCsp>,
pub cors: Option<HttpCors>,
pub timeout: Option<u16>,
pub fields: Option<Vec<TemplateField>>,
pub globals: Option<Vec<String>>,
pub flags: Option<Vec<TemplateFlagRef>>,
pub params: Option<Vec<TemplateParamRef>>,
pub models: Option<Vec<TemplateRef>>,
pub content: Option<Vec<TemplateRef>>,
pub actions: Option<Vec<String>>,
pub wasm_opt: Option<WasmOpt>,
pub variables: Option<Vec<String>>,
pub middlewares: Option<Vec<String>>,
}Expand description
Template configuration for Ordinary Applications.
Fields§
§ffi: TemplateFfiForeign function interface config
idx: u8Unique index for template.
name: StringTemplate’s name.
mime: StringUsed as the content-type header for HTTP responses.
Validated against file extension (if path is present).
minify: Option<bool>Specifies whether the content in the file should be “minified”/have whitespace removed.
path: Option<String>Relative path to the template file
route: StringThe route used in the HTTP server to serve this template. Can use segments to bind to properties on models or content
protected: Option<Check>What to check the token fields against. If left blank, route is considered public.
cache: Option<TemplateCache>Used to specify the cache policy for this template.
csp: Option<HttpCsp>HTTP Content Security Policy configuration.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP
“Base” defaults to default-src 'self'; and tacks on SHA-256 integrity
hashes for all inlined scripts and styles (generated at build time) to
script-src 'self' sha256-b64 and style-src 'self' sha256-b64, respectively.
https: is used when not running in --insecure mode.
cors: Option<HttpCors>§timeout: Option<u16>Max duration for the template.
Unit: seconds
fields: Option<Vec<TemplateField>>Used for template-specific variables that don’t need to be shared beyond the scope of the given template, and don’t warrant a content object.
globals: Option<Vec<String>>List of global variables to be included with the compiled template binary. Globals are excluded by default and have to be explicitly listed in the globals to be accessed from the template.
flags: Option<Vec<TemplateFlagRef>>List of flags to be referenced by the template.
params: Option<Vec<TemplateParamRef>>List of params to be referenced by the template.
models: Option<Vec<TemplateRef>>List of models and what fields the template needs from the models. This is effectively a query definition.
content: Option<Vec<TemplateRef>>List of content definitions and the content definition fields that this template will use.
actions: Option<Vec<String>>Specifies which actions this template triggers, and adds this template’s route pattern to the action’s list of valid origins.
wasm_opt: Option<WasmOpt>§variables: Option<Vec<String>>List of build time environment variables.
format in template: {{ YOUR_VAR }}
middlewares: Option<Vec<String>>list of names of middleware to include for this template
Trait Implementations§
Source§impl Clone for TemplateConfig
impl Clone for TemplateConfig
Source§fn clone(&self) -> TemplateConfig
fn clone(&self) -> TemplateConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ComposeSchema for TemplateConfig
impl ComposeSchema for TemplateConfig
Source§impl Debug for TemplateConfig
impl Debug for TemplateConfig
Source§impl Default for TemplateConfig
impl Default for TemplateConfig
Source§fn default() -> TemplateConfig
fn default() -> TemplateConfig
Source§impl<'de> Deserialize<'de> for TemplateConfig
impl<'de> Deserialize<'de> for TemplateConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for TemplateConfig
impl JsonSchema for TemplateConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more