Struct netlify_toml::Config [−][src]
pub struct Config {
pub build: Option<Build>,
pub context: Option<HashMap<String, Context>>,
pub edge_handlers: Vec<EdgeHandler>,
pub functions: Option<Functions>,
pub headers: Option<Vec<Header>>,
pub redirects: Option<Vec<Redirect>>,
pub template: Option<Template>,
}
Expand description
Config represents the full configuration within a netlify.toml file.
Fields
build: Option<Build>
context: Option<HashMap<String, Context>>
edge_handlers: Vec<EdgeHandler>
functions: Option<Functions>
headers: Option<Vec<Header>>
redirects: Option<Vec<Redirect>>
template: Option<Template>
Implementations
Returns a HashMap that aggregates all environment variables for a context within a git branch.
Arguments
ctx
- The context name, for example deploy-preview
, branch-deploy
or production
.
branch
- The deploy branch name, for example make-changes-to-my-site
.
Example
let io = r#"
[build]
command = "make site"
"#;
let config = netlify_toml::from_str(io).unwrap();
let env = config.context_env("deploy-preview", "new-styles");
Trait Implementations
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Config
impl UnwindSafe for Config
Blanket Implementations
Mutably borrows from an owned value. Read more