pub struct ContainerRuntime { /* private fields */ }Expand description
Docker/Podman-based Lambda execution engine.
Implementations§
Source§impl ContainerRuntime
impl ContainerRuntime
Sourcepub fn new() -> Option<Self>
pub fn new() -> Option<Self>
Auto-detect Docker or Podman. Returns None if neither is available.
Override with FAKECLOUD_CONTAINER_CLI env var.
pub fn cli_name(&self) -> &str
Sourcepub async fn invoke(
&self,
func: &LambdaFunction,
payload: &[u8],
) -> Result<Vec<u8>, RuntimeError>
pub async fn invoke( &self, func: &LambdaFunction, payload: &[u8], ) -> Result<Vec<u8>, RuntimeError>
Invoke a Lambda function, starting a container if needed.
Sourcepub async fn stop_container(&self, function_name: &str)
pub async fn stop_container(&self, function_name: &str)
Stop and remove a container for a specific function.
Sourcepub async fn stop_all(&self)
pub async fn stop_all(&self)
Stop and remove all containers (used on server shutdown or reset).
Sourcepub fn list_warm_containers(
&self,
lambda_state: &SharedLambdaState,
) -> Vec<Value>
pub fn list_warm_containers( &self, lambda_state: &SharedLambdaState, ) -> Vec<Value>
List all warm containers and their metadata for introspection.
Sourcepub async fn evict_container(&self, function_name: &str) -> bool
pub async fn evict_container(&self, function_name: &str) -> bool
Evict (stop and remove) the warm container for a specific function. Returns true if a container was found and evicted.
Sourcepub async fn run_cleanup_loop(self: Arc<Self>, ttl: Duration)
pub async fn run_cleanup_loop(self: Arc<Self>, ttl: Duration)
Background loop that stops containers idle longer than ttl.
Auto Trait Implementations§
impl !Freeze for ContainerRuntime
impl !RefUnwindSafe for ContainerRuntime
impl Send for ContainerRuntime
impl Sync for ContainerRuntime
impl Unpin for ContainerRuntime
impl UnsafeUnpin for ContainerRuntime
impl !UnwindSafe for ContainerRuntime
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