(
credentials: &FtpCredentials,
file_name: &str,
file_path: Option<&str>,
)
| 108 | } |
| 109 | |
| 110 | pub async fn fetch_compressed_object( |
| 111 | credentials: &FtpCredentials, |
| 112 | file_name: &str, |
| 113 | file_path: Option<&str>, |
| 114 | ) -> Result<(Vec<u8>, usize), String> { |
| 115 | let response = get_object(credentials, file_name, file_path).await; |
| 116 | match response { |
| 117 | Ok(buffer) => { |
| 118 | let size = buffer.len(); |
| 119 | Ok((decompress(&buffer).map_err(err_to_string)?, size)) |
| 120 | } |
| 121 | Err(err) => Err(format!("Failed to get json file: {}", err)), |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | pub async fn upload_compressed_object( |
| 126 | credentials: &FtpCredentials, |
no test coverage detected