MCPcopy Create free account
hub / github.com/aws/aws-lambda-rust-runtime / put_file

Method put_file

examples/basic-s3-thumbnail/src/s3.rs:40–49  ·  view source on GitHub ↗
(&self, bucket: &str, key: &str, vec: Vec<u8>)

Source from the content-addressed store, hash-verified

38#[async_trait]
39impl PutFile for S3Client {
40 async fn put_file(&self, bucket: &str, key: &str, vec: Vec<u8>) -> Result<String, String> {
41 tracing::info!("put file bucket {}, key {}", bucket, key);
42 let bytes = ByteStream::from(vec);
43 let result = self.put_object().bucket(bucket).key(key).body(bytes).send().await;
44
45 match result {
46 Ok(_) => Ok(format!("Uploaded a file with key {key} into {bucket}")),
47 Err(err) => Err(err.into_service_error().meta().message().unwrap().to_string()),
48 }
49 }
50}

Callers 1

function_handlerFunction · 0.80

Calls 1

sendMethod · 0.80

Tested by

no test coverage detected