(
&self,
contents: &String,
file_path: Option<&str>,
)
| 107 | } |
| 108 | |
| 109 | pub async fn write_data( |
| 110 | &self, |
| 111 | contents: &String, |
| 112 | file_path: Option<&str>, |
| 113 | ) -> Result<String, String> { |
| 114 | match self.get_driver() { |
| 115 | Ok(driver) => { |
| 116 | let time = SystemTime::now() |
| 117 | .duration_since(UNIX_EPOCH) |
| 118 | .unwrap() |
| 119 | .as_millis(); |
| 120 | let file_name = self.create_file_name(time); |
| 121 | let response = driver.upload_object(&file_name, contents, file_path).await; |
| 122 | |
| 123 | match response { |
| 124 | Ok(_) => Ok(file_name), |
| 125 | Err(_) => Err(String::from("Failed to save data file")), |
| 126 | } |
| 127 | } |
| 128 | Err(err) => Err(err.to_string()), |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | pub async fn fetch_compressed_data_by_key( |
| 133 | &self, |
nothing calls this directly
no test coverage detected