MCPcopy Create free account
hub / github.com/actix/examples / fetch_file

Method fetch_file

forms/multipart-s3/src/client.rs:34–51  ·  view source on GitHub ↗
(&self, key: &str)

Source from the content-addressed store, hash-verified

32 }
33
34 pub async fn fetch_file(&self, key: &str) -> Option<(u64, ByteStream)> {
35 let object = self
36 .s3
37 .get_object()
38 .bucket(&self.bucket_name)
39 .key(key)
40 .send()
41 .await
42 .ok()?;
43
44 Some((
45 object
46 .content_length()
47 .and_then(|len| len.try_into().ok())
48 .expect("file has invalid size"),
49 object.body,
50 ))
51 }
52
53 pub async fn upload_files(
54 &self,

Callers 1

fetch_from_s3Function · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected