Function edjx::storage::get[][src]

pub fn get<B, FN>(
    bucket_id: B,
    file_name: FN
) -> Result<StorageResponse, StorageError> where
    B: AsRef<str>,
    FN: AsRef<str>, 
Expand description

Returns a file from the EDJX Object Store.

Example

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

  let mut res_bytes: StorageResponse = match storage::get(&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())
    }
 };