pub struct Stack {
pub id: String,
pub resources: IndexMap<String, ResourceEntry>,
pub permissions: PermissionsConfig,
pub supported_platforms: Option<Vec<Platform>>,
pub inputs: Vec<StackInputDefinition>,
}Expand description
A bag of resources, unaware of any cloud.
Fields§
§id: StringUnique identifier for the stack
resources: IndexMap<String, ResourceEntry>Map of resource IDs to their configurations and lifecycle settings
permissions: PermissionsConfigCombined permissions configuration containing both profiles and management
supported_platforms: Option<Vec<Platform>>Which platforms this stack supports. When None, all platforms are supported.
inputs: Vec<StackInputDefinition>Input definitions required before setup or deployment can proceed.
Implementations§
Source§impl Stack
impl Stack
Sourcepub fn new(id: String) -> StackBuilder
pub fn new(id: String) -> StackBuilder
Create an instance of Stack using the builder syntax
Source§impl Stack
impl Stack
Sourcepub fn frozen_resources_digest(&self) -> String
pub fn frozen_resources_digest(&self) -> String
Returns a deterministic digest of the complete Frozen resource set. Resource and object-key ordering do not affect the digest.
Sourcepub fn resources(&self) -> impl Iterator<Item = (&String, &ResourceEntry)>
pub fn resources(&self) -> impl Iterator<Item = (&String, &ResourceEntry)>
Returns an iterator over the resources in the stack, including their lifecycle state.
Sourcepub fn resources_mut(
&mut self,
) -> impl Iterator<Item = (&String, &mut ResourceEntry)>
pub fn resources_mut( &mut self, ) -> impl Iterator<Item = (&String, &mut ResourceEntry)>
Returns a mutable iterator over the resources in the stack, including their lifecycle state.
pub fn id(&self) -> &str
Sourcepub fn permissions(&self) -> &PermissionsConfig
pub fn permissions(&self) -> &PermissionsConfig
Returns the permissions configuration for the stack.
Sourcepub fn permission_profiles(&self) -> &IndexMap<String, PermissionProfile>
pub fn permission_profiles(&self) -> &IndexMap<String, PermissionProfile>
Returns the permission profiles for the stack.
Sourcepub fn management(&self) -> &ManagementPermissions
pub fn management(&self) -> &ManagementPermissions
Returns the management permissions configuration for the stack.
Sourcepub fn supported_platforms(&self) -> Option<&[Platform]>
pub fn supported_platforms(&self) -> Option<&[Platform]>
Returns the supported platforms, or None if all platforms are supported.
Sourcepub fn inputs(&self) -> &[StackInputDefinition]
pub fn inputs(&self) -> &[StackInputDefinition]
Returns stack input definitions.
Sourcepub fn supports_platform(&self, platform: &Platform) -> bool
pub fn supports_platform(&self, platform: &Platform) -> bool
Returns true if the given platform is supported by this stack. When supported_platforms is None, all platforms are supported.
Source§impl Stack
impl Stack
Sourcepub fn command_targets(&self) -> Vec<CommandTarget>
pub fn command_targets(&self) -> Vec<CommandTarget>
Returns the ordered list of command-capable targets in this stack:
Worker, Container, and Daemon resources with commands_enabled set,
in stack declaration order.
Declaration order is the order resources were added to the stack
(via StackBuilder::add/add_with_dependencies/add_with_remote_access).
resources is an IndexMap, which preserves insertion order, so
iterating it directly yields declaration order without any extra
bookkeeping.
Sourcepub fn worker_command_push_env_vars(
&self,
commands_token: Option<&str>,
) -> Result<Vec<EnvironmentVariable>>
pub fn worker_command_push_env_vars( &self, commands_token: Option<&str>, ) -> Result<Vec<EnvironmentVariable>>
Returns the authentication token used by the manager/operator to push commands to each command-enabled Local/Kubernetes Worker runtime. Cloud-native Worker transports authenticate through their platform and do not use this helper.
Sourcepub fn receiver_command_env_vars(
&self,
commands_url: &str,
commands_token: Option<&str>,
) -> Result<Vec<EnvironmentVariable>>
pub fn receiver_command_env_vars( &self, commands_url: &str, commands_token: Option<&str>, ) -> Result<Vec<EnvironmentVariable>>
Returns the command receiver environment variables for each
command-enabled Container and Daemon in this stack, scoped via
target_resources so every var reaches only its own resource.
Workers receive platform pushes; Containers and Daemons run the pull receiver, which reads this fixed environment contract:
ALIEN_COMMANDS_URL(Plain) — base receiver URLALIEN_COMMANDS_TOKEN(Secret, only if a token is present)ALIEN_COMMANDS_TARGET_RESOURCE_ID(Plain) — this resource’s idALIEN_COMMANDS_TARGET_RESOURCE_TYPE(Plain) —container/daemon
ALIEN_DEPLOYMENT_ID is intentionally NOT emitted here: the manager and
operator already inject it deployment-wide (target_resources: None), so
it reaches every Container/Daemon via that path — re-scoping it per
resource would be redundant. This mirrors the worker helper, which also
relies on the deployment-wide ALIEN_DEPLOYMENT_ID.
Workers are excluded here, and a
commands-disabled Container/Daemon is never a command_targets() entry,
so it receives nothing — the receiver fail-fasts on a partial config, so
a deployment-wide flag would crash it at startup.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Stack
impl<'de> Deserialize<'de> for Stack
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>,
impl Eq for Stack
impl StructuralPartialEq for Stack
Auto Trait Implementations§
impl !RefUnwindSafe for Stack
impl !UnwindSafe for Stack
impl Freeze for Stack
impl Send for Stack
impl Sync for Stack
impl Unpin for Stack
impl UnsafeUnpin for Stack
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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.