pub struct Function {
pub id: String,
pub links: Vec<ResourceRef>,
pub triggers: Vec<FunctionTrigger>,
pub permissions: String,
pub code: FunctionCode,
pub memory_mb: u32,
pub timeout_seconds: u32,
pub environment: HashMap<String, String>,
pub ingress: Ingress,
pub arc_enabled: bool,
pub concurrency_limit: Option<u32>,
pub readiness_probe: Option<ReadinessProbe>,
}Expand description
Represents a serverless function that executes code in response to triggers or direct invocations. Functions are the primary compute resource in serverless applications, designed to be stateless and ephemeral.
Fields§
§id: StringIdentifier for the function. Must contain only alphanumeric characters, hyphens, and underscores ([A-Za-z0-9-_]). Maximum 64 characters.
links: Vec<ResourceRef>List of resource references this function depends on.
triggers: Vec<FunctionTrigger>List of triggers that define what events automatically invoke this function. If empty, the function is only invokable directly via HTTP calls or platform-specific invocation APIs. When configured, the function will be automatically invoked when any of the specified trigger conditions are met.
permissions: StringPermission profile name that defines the permissions granted to this function. This references a profile defined in the stack’s permission definitions.
code: FunctionCodeCode for the function, either a pre-built image or source code to be built.
memory_mb: u32Memory allocated to the function in megabytes (MB). Constraints: 128‑32768 MB (platform-specific limits may apply) Default: 256
timeout_seconds: u32Maximum execution time for the function in seconds. Constraints: 1‑3600 seconds (platform-specific limits may apply) Default: 30
environment: HashMap<String, String>Key-value pairs to set as environment variables for the function.
ingress: IngressControls network accessibility of the function.
arc_enabled: boolWhether the function can be invoked via ARC (Alien Remote Call) protocol from the control plane. When enabled, the necessary queue infrastructure is automatically created for the target platform.
concurrency_limit: Option<u32>Maximum number of concurrent executions allowed for the function. None means platform default applies.
readiness_probe: Option<ReadinessProbe>Optional readiness probe configuration. Only applicable for functions with Public ingress. When configured, the probe will be executed after provisioning/update to verify the function is ready.
Implementations§
Source§impl Function
impl Function
Sourcepub fn new(id: String) -> FunctionBuilder
pub fn new(id: String) -> FunctionBuilder
Create an instance of Function using the builder syntax
Source§impl Function
impl Function
Sourcepub const RESOURCE_TYPE: ResourceType
pub const RESOURCE_TYPE: ResourceType
The resource type identifier for Functions
Sourcepub fn get_permissions(&self) -> &str
pub fn get_permissions(&self) -> &str
Returns the permission profile name for this function.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
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 ResourceDefinition for Function
impl ResourceDefinition for Function
Source§fn resource_type() -> ResourceType
fn resource_type() -> ResourceType
Source§fn get_resource_type(&self) -> ResourceType
fn get_resource_type(&self) -> ResourceType
Source§fn get_dependencies(&self) -> Vec<ResourceRef>
fn get_dependencies(&self) -> Vec<ResourceRef>
Source§fn get_permissions(&self) -> Option<&str>
fn get_permissions(&self) -> Option<&str>
Source§fn validate_update(&self, new_config: &dyn ResourceDefinition) -> Result<()>
fn validate_update(&self, new_config: &dyn ResourceDefinition) -> Result<()>
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Source§fn box_clone(&self) -> Box<dyn ResourceDefinition>
fn box_clone(&self) -> Box<dyn ResourceDefinition>
Source§fn resource_eq(&self, other: &dyn ResourceDefinition) -> bool
fn resource_eq(&self, other: &dyn ResourceDefinition) -> bool
impl Eq for Function
impl StructuralPartialEq for Function
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnsafeUnpin for Function
impl UnwindSafe for Function
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.