Skip to main content

Function

Trait Function 

Source
pub trait Function: Binding {
    // Required methods
    fn invoke<'life0, 'async_trait>(
        &'life0 self,
        request: FunctionInvokeRequest,
    ) -> Pin<Box<dyn Future<Output = Result<FunctionInvokeResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_function_url<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn as_any(&self) -> &dyn Any;
}
Expand description

A trait for function bindings that enable direct function-to-function calls

Required Methods§

Source

fn invoke<'life0, 'async_trait>( &'life0 self, request: FunctionInvokeRequest, ) -> Pin<Box<dyn Future<Output = Result<FunctionInvokeResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Invoke a function with HTTP request data.

This enables direct, low-latency function-to-function communication within the same cloud environment, bypassing ARC for internal calls.

Platform implementations:

  • AWS: Uses InvokeFunction API directly
  • GCP: Calls private service URL directly
  • Azure: Calls private container app URL directly
  • Kubernetes: HTTP call to internal service
Source

fn get_function_url<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the public URL of the function, if available.

Returns the function’s public URL if it exists and is accessible. This is useful for exposing public endpoints or getting URLs for external integration.

Platform implementations:

  • AWS: Uses GetFunctionUrlConfig API or returns URL from binding
  • GCP: Returns Cloud Run service URL or calls get_service API
  • Azure: Returns Container App URL or calls get_container_app API
Source

fn as_any(&self) -> &dyn Any

Get a reference to this object as Any for dynamic casting

Implementors§