Skip to main content

GenerateEnvParams

Struct GenerateEnvParams 

Source
pub struct GenerateEnvParams<'a> {
Show 14 fields pub config: &'a Config, pub service_def: &'a ServiceDef, pub auth_kind: Option<&'a AuthKind>, pub host_port: Option<u16>, pub resolved_ports: &'a [(String, u16)], pub env_overrides: &'a BTreeMap<String, String>, pub exposure: &'a Exposure, pub extra_env: BTreeMap<String, String>, pub pre_built_ctx: Option<BTreeMap<String, String>>, pub enable_smtp: bool, pub enabled_groups: &'a BTreeSet<String>, pub selected_choices: &'a BTreeMap<String, String>, pub existing_env_file: Option<&'a str>, pub allow_unset_required: bool,
}
Expand description

Parameters for generate_env.

Fields§

§config: &'a Config§service_def: &'a ServiceDef§auth_kind: Option<&'a AuthKind>

The auth kind the user chose to enable, if any.

§host_port: Option<u16>

Primary host port (for service.url / service.port templating).

§resolved_ports: &'a [(String, u16)]

Per-port resolved host ports, keyed by port name (e.g. “http”, “smtp”). Used to emit PORT_* lines in the .env file — each entry here corresponds to one [[ports]] definition in service.toml.

§env_overrides: &'a BTreeMap<String, String>§exposure: &'a Exposure

How the service is exposed; its URL (if any) feeds templates like {{service.external_url}} / {{service.domain}}.

§extra_env: BTreeMap<String, String>

Additional env vars to append to the .env file (e.g., CA cert trust vars).

§pre_built_ctx: Option<BTreeMap<String, String>>

Pre-built template context. When provided, secrets and auth credentials from this context are reused instead of generating fresh ones. This ensures the values shown during interactive prompts match what gets written to the .env file.

§enable_smtp: bool

Whether this service should use the globally configured SMTP. When false, smtp.* is left out of the context and [mappings.smtp] is skipped — lets the user opt a single service out of email without clearing the global SMTP config.

§enabled_groups: &'a BTreeSet<String>

Names of [[env_group]] entries the user toggled on. Members of groups not listed here are fully omitted from the generated .env.

§selected_choices: &'a BTreeMap<String, String>

[[choice]] selections (choice name -> option name). Only the selected option’s members are written; absent choices fall back to their declared default.

§existing_env_file: Option<&'a str>

Raw contents of the service’s existing on-disk .env, when one is already present (a re-add, or a hand-authored “bring your own” file). The generated env is merged into this rather than overwriting it: existing lines, comments, and keys the registry doesn’t know about are preserved; only keys the user set this run (env_overrides) are updated in place; new declared keys are appended. None for a fresh install (no file yet) — the generated content is written as-is.

§allow_unset_required: bool

Skip-setup: render an unset Required var that is a member of an enabled group / selected choice to an empty value instead of erroring, so an install can proceed with the operator filling the blanks in .env afterwards. false keeps the strict default (a missing required member is a hard error). A top-level required var renders empty either way — it’s gated at the CLI prompt layer, not here.

Auto Trait Implementations§

§

impl<'a> Freeze for GenerateEnvParams<'a>

§

impl<'a> RefUnwindSafe for GenerateEnvParams<'a>

§

impl<'a> Send for GenerateEnvParams<'a>

§

impl<'a> Sync for GenerateEnvParams<'a>

§

impl<'a> Unpin for GenerateEnvParams<'a>

§

impl<'a> UnsafeUnpin for GenerateEnvParams<'a>

§

impl<'a> UnwindSafe for GenerateEnvParams<'a>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V