Function edjx::storage::get_attributes

source ·
pub fn get_attributes<B, FN>(
    bucket_id: B,
    file_name: FN
) -> Result<FileAttributes, StorageError>where
    B: AsRef<str>,
    FN: AsRef<str>,
Expand description

Returns attributes associated with the given file from the EDJX Object Store.

Example

  let bucket_id = "af66ad83-e55b-4a71-a7d5-6ec3199e42e9";
  let file_name = "example.txt";

  let mut attributes: FileAttributes = match storage::get_attributes(&bucket_id, &file_name) {
   Ok(r) => r,
   Err(e) => {
       return HttpResponse::from(e.to_string().as_str().to_owned())
           .set_status(e.to_http_status_code())
   }
};