MCPcopy Create free account
hub / github.com/BitVM/BitVM / upload_object

Method upload_object

bridge/src/client/data_store/aws_s3.rs:80–100  ·  view source on GitHub ↗
(
        &self,
        key: &str,
        data: ByteStream,
        file_path: Option<&str>,
    )

Source from the content-addressed store, hash-verified

78 }
79
80 async fn upload_object(
81 &self,
82 key: &str,
83 data: ByteStream,
84 file_path: Option<&str>,
85 ) -> Result<PutObjectOutput, SdkError<PutObjectError>> {
86 let key_with_prefix;
87 if let Some(path) = file_path {
88 key_with_prefix = format! {"{path}/{key}"};
89 } else {
90 key_with_prefix = key.to_string();
91 }
92
93 self.client
94 .put_object()
95 .bucket(&self.bucket)
96 .key(key_with_prefix)
97 .body(data)
98 .send()
99 .await
100 }
101}
102
103#[async_trait]

Callers 1

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected