pub trait ConfigProvider {
// Required methods
fn get_function_settings(&self) -> Result<FunctionSettings, RuntimeError>;
fn get_runtime_api_endpoint(&self) -> Result<String, RuntimeError>;
}
Expand description
Trait used by the RustRuntime
module to retrieve configuration information
about the environement. This is implemented by the EnvConfigProvider
using
the environment variables. We also have a mock implementation for the unit tests
Required Methods§
Sourcefn get_function_settings(&self) -> Result<FunctionSettings, RuntimeError>
fn get_function_settings(&self) -> Result<FunctionSettings, RuntimeError>
Loads the function settings such as name, arn, memory amount, version, etc.
§Return
A Result
of FunctionSettings
or a RuntimeError
. The runtime
fails the init process if this function returns an error.
Sourcefn get_runtime_api_endpoint(&self) -> Result<String, RuntimeError>
fn get_runtime_api_endpoint(&self) -> Result<String, RuntimeError>
Returns the endpoint (hostname:port) for the Runtime API endpoint