pub trait LambdaBackend:
Send
+ Sync
+ 'static {
// Required methods
fn name(&self) -> &str;
fn launch<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
func: &'life1 LambdaFunction,
code_zip: Option<&'life2 [u8]>,
layers: &'life3 [Vec<u8>],
deploy_id: &'life4 str,
) -> Pin<Box<dyn Future<Output = Result<WarmInstance, RuntimeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
fn terminate<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 BackendHandle,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn reap_stale<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Required Methods§
Sourcefn name(&self) -> &str
fn name(&self) -> &str
Short identifier surfaced via logs and introspection (e.g.
"docker", "podman", "kubernetes").
Sourcefn launch<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
func: &'life1 LambdaFunction,
code_zip: Option<&'life2 [u8]>,
layers: &'life3 [Vec<u8>],
deploy_id: &'life4 str,
) -> Pin<Box<dyn Future<Output = Result<WarmInstance, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn launch<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
func: &'life1 LambdaFunction,
code_zip: Option<&'life2 [u8]>,
layers: &'life3 [Vec<u8>],
deploy_id: &'life4 str,
) -> Pin<Box<dyn Future<Output = Result<WarmInstance, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Launch a fresh runtime instance for func using the supplied
code (for zip-package functions) or func.image_uri (for image
package functions). layers are the attached layer ZIPs in
attach order. deploy_id is the facade-computed fingerprint
used to label resources so reaper logic can correlate.
Sourcefn terminate<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 BackendHandle,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn terminate<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 BackendHandle,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Tear down one instance. Must be idempotent — the facade may call this against an already-gone instance during cleanup races.
Provided Methods§
Sourcefn reap_stale<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reap_stale<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sweep instances that belong to a previous fakecloud process so their function names don’t leak across restarts. Default no-op; backends with out-of-process state should override.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".