pub struct FunctionBuilder<S: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<S: State> FunctionBuilder<S>
impl<S: State> FunctionBuilder<S>
Sourcepub fn build(self) -> Functionwhere
S: IsComplete,
pub fn build(self) -> Functionwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn permissions(self, value: String) -> FunctionBuilder<SetPermissions<S>>where
S::Permissions: IsUnset,
pub fn permissions(self, value: String) -> FunctionBuilder<SetPermissions<S>>where
S::Permissions: IsUnset,
Required.
Permission profile name that defines the permissions granted to this function. This references a profile defined in the stack’s permission definitions.
Sourcepub fn code(self, value: FunctionCode) -> FunctionBuilder<SetCode<S>>where
S::Code: IsUnset,
pub fn code(self, value: FunctionCode) -> FunctionBuilder<SetCode<S>>where
S::Code: IsUnset,
Required.
Code for the function, either a pre-built image or source code to be built.
Sourcepub fn memory_mb(self, value: u32) -> FunctionBuilder<SetMemoryMb<S>>where
S::MemoryMb: IsUnset,
pub fn memory_mb(self, value: u32) -> FunctionBuilder<SetMemoryMb<S>>where
S::MemoryMb: IsUnset,
Sourcepub fn maybe_memory_mb(
self,
value: Option<u32>,
) -> FunctionBuilder<SetMemoryMb<S>>where
S::MemoryMb: IsUnset,
pub fn maybe_memory_mb(
self,
value: Option<u32>,
) -> FunctionBuilder<SetMemoryMb<S>>where
S::MemoryMb: IsUnset,
Sourcepub fn timeout_seconds(
self,
value: u32,
) -> FunctionBuilder<SetTimeoutSeconds<S>>where
S::TimeoutSeconds: IsUnset,
pub fn timeout_seconds(
self,
value: u32,
) -> FunctionBuilder<SetTimeoutSeconds<S>>where
S::TimeoutSeconds: IsUnset,
Sourcepub fn maybe_timeout_seconds(
self,
value: Option<u32>,
) -> FunctionBuilder<SetTimeoutSeconds<S>>where
S::TimeoutSeconds: IsUnset,
pub fn maybe_timeout_seconds(
self,
value: Option<u32>,
) -> FunctionBuilder<SetTimeoutSeconds<S>>where
S::TimeoutSeconds: IsUnset,
Sourcepub fn environment(
self,
value: HashMap<String, String>,
) -> FunctionBuilder<SetEnvironment<S>>where
S::Environment: IsUnset,
pub fn environment(
self,
value: HashMap<String, String>,
) -> FunctionBuilder<SetEnvironment<S>>where
S::Environment: IsUnset,
Sourcepub fn maybe_environment(
self,
value: Option<HashMap<String, String>>,
) -> FunctionBuilder<SetEnvironment<S>>where
S::Environment: IsUnset,
pub fn maybe_environment(
self,
value: Option<HashMap<String, String>>,
) -> FunctionBuilder<SetEnvironment<S>>where
S::Environment: IsUnset,
Sourcepub fn ingress(self, value: Ingress) -> FunctionBuilder<SetIngress<S>>where
S::Ingress: IsUnset,
pub fn ingress(self, value: Ingress) -> FunctionBuilder<SetIngress<S>>where
S::Ingress: IsUnset,
Sourcepub fn maybe_ingress(
self,
value: Option<Ingress>,
) -> FunctionBuilder<SetIngress<S>>where
S::Ingress: IsUnset,
pub fn maybe_ingress(
self,
value: Option<Ingress>,
) -> FunctionBuilder<SetIngress<S>>where
S::Ingress: IsUnset,
Sourcepub fn commands_enabled(
self,
value: bool,
) -> FunctionBuilder<SetCommandsEnabled<S>>where
S::CommandsEnabled: IsUnset,
pub fn commands_enabled(
self,
value: bool,
) -> FunctionBuilder<SetCommandsEnabled<S>>where
S::CommandsEnabled: IsUnset,
Sourcepub fn maybe_commands_enabled(
self,
value: Option<bool>,
) -> FunctionBuilder<SetCommandsEnabled<S>>where
S::CommandsEnabled: IsUnset,
pub fn maybe_commands_enabled(
self,
value: Option<bool>,
) -> FunctionBuilder<SetCommandsEnabled<S>>where
S::CommandsEnabled: IsUnset,
Sourcepub fn concurrency_limit(
self,
value: u32,
) -> FunctionBuilder<SetConcurrencyLimit<S>>where
S::ConcurrencyLimit: IsUnset,
pub fn concurrency_limit(
self,
value: u32,
) -> FunctionBuilder<SetConcurrencyLimit<S>>where
S::ConcurrencyLimit: IsUnset,
Sourcepub fn maybe_concurrency_limit(
self,
value: Option<u32>,
) -> FunctionBuilder<SetConcurrencyLimit<S>>where
S::ConcurrencyLimit: IsUnset,
pub fn maybe_concurrency_limit(
self,
value: Option<u32>,
) -> FunctionBuilder<SetConcurrencyLimit<S>>where
S::ConcurrencyLimit: IsUnset,
Sourcepub fn readiness_probe(
self,
value: ReadinessProbe,
) -> FunctionBuilder<SetReadinessProbe<S>>where
S::ReadinessProbe: IsUnset,
pub fn readiness_probe(
self,
value: ReadinessProbe,
) -> FunctionBuilder<SetReadinessProbe<S>>where
S::ReadinessProbe: IsUnset,
Sourcepub fn maybe_readiness_probe(
self,
value: Option<ReadinessProbe>,
) -> FunctionBuilder<SetReadinessProbe<S>>where
S::ReadinessProbe: IsUnset,
pub fn maybe_readiness_probe(
self,
value: Option<ReadinessProbe>,
) -> FunctionBuilder<SetReadinessProbe<S>>where
S::ReadinessProbe: IsUnset,
Source§impl<S: State> FunctionBuilder<S>
impl<S: State> FunctionBuilder<S>
Sourcepub fn link<R: ?Sized>(self, resource: &R) -> Self
pub fn link<R: ?Sized>(self, resource: &R) -> Self
Links the function to another resource with specified permissions.
Accepts a reference to any type R where &R can be converted into ResourceRef.
Sourcepub fn trigger(self, trigger: FunctionTrigger) -> Self
pub fn trigger(self, trigger: FunctionTrigger) -> Self
Adds a trigger to the function. Functions can have multiple triggers. Each trigger will independently invoke the function when its conditions are met.
§Examples
let function = Function::new("my-function".to_string())
.code(FunctionCode::Image { image: "test:latest".to_string() })
.permissions("execution".to_string())
.trigger(FunctionTrigger::queue(&queue1))
.trigger(FunctionTrigger::queue(&queue2))
.build();Auto Trait Implementations§
impl<S> Freeze for FunctionBuilder<S>
impl<S> RefUnwindSafe for FunctionBuilder<S>
impl<S> Send for FunctionBuilder<S>
impl<S> Sync for FunctionBuilder<S>
impl<S> Unpin for FunctionBuilder<S>
impl<S> UnsafeUnpin for FunctionBuilder<S>
impl<S> UnwindSafe for FunctionBuilder<S>
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
Mutably borrows from an owned value. Read more