fn invoke<T>(&mut self, body: String) -> T
    where
        T: DeserializeOwned,
    {
        // Setup the request
        let mut lambda_fun = InvocationRequest::default();
        lambda_fun.function_name = self.config.metadata_lambda.clone();

        // COnvert body to Bytes
        lambda_fun.payload = Some(Bytes::from(body));
        trace!("Invoking lambda function: {}", lambda_fun.function_name);
        let result_future = self.client.invoke(lambda_fun);
        let result = result_future.sync().unwrap();

        // print the body
        let payload = result.payload.unwrap();
        trace!("{}", std::str::from_utf8(&payload).unwrap());
        let reader = payload.into_buf().reader();
        trace!("Result: {:?}", reader);
        return serde_json::from_reader(reader).unwrap();
    }
/// Generic invoke method to handle the request serialization and invocation.
/// The return value is automatically inferred and populated based on
/// the caller.
Generic invoke method to handle the request serialization and invocation.
The return value is automatically inferred and populated based on
the caller.
Generic invoke method to handle the request serialization and invocation . The return value is automatically inferred and populated based on the caller .
fn invoke<T>(&mut self, body: String) -> T
    where
        T: DeserializeOwned,
    {
        // Setup the request
        let mut lambda_fun = InvocationRequest::default();
        lambda_fun.function_name = self.config.metadata_lambda.clone();
        // COnvert body to Bytes
        lambda_fun.payload = Some(Bytes::from(body));
        trace!("Invoking lambda function: {}", lambda_fun.function_name);
        let result_future = self.client.invoke(lambda_fun);
        let result = result_future.sync().unwrap();
        // print the body
        let payload = result.payload.unwrap();
        trace!("{}", std::str::from_utf8(&payload).unwrap());
        let reader = payload.into_buf().reader();
        trace!("Result: {:?}", reader);
        return serde_json::from_reader(reader).unwrap();
    }
fn invoke < T > ( & mut self , body : String ) -> T where T : DeserializeOwned , { // Setup the request let mut lambda_fun = InvocationRequest :: default ( ) ; lambda_fun . function_name = self . config . metadata_lambda . clone ( ) ; // COnvert body to Bytes lambda_fun . payload = Some ( Bytes :: from ( body ) ) ; trace ! ( " " lambda_fun function_name ) ; let result_future = self . client . invoke ( lambda_fun ) ; let result = result_future . sync ( ) . unwrap ( ) ; // print the body let payload = result . payload . unwrap ( ) ; trace ! ( " " std str from_utf8 ( payload ) unwrap ( ) ) ; let reader = payload . into_buf ( ) . reader ( ) ; trace ! ( " " reader ) ; return serde_json :: from_reader ( reader ) . unwrap ( ) ; }
Generic invoke method to handle the request serialization and invocation.
Generic invoke method to handle the request serialization and invocation .
&mut self
body
String
&mut self
body
String