Crate uploads_im_client

Source
Expand description

§Uploads.im Client

This crate is a thin wrapper that models the Uploads.im web API. Currently, the only functionality available to Uploads.im users is the upload endpoint.

NOTE: At the time of writing, the Uploads.im service is not accepting new uploads. You will most likely need to find an alternate provider right now.

§Examples

use {reqwest::Client, uploads_im_client::upload_with_default_options};

#[tokio::main]
async fn main() {
    let uploaded_image = upload_with_default_options(
        &mut Client::new(),
        "my_image.jpg".to_owned().into(),
    ) .await.expect("successful image upload");
    println!("Uploaded image! You can now view it at {}", uploaded_image.view_url.as_str());
}

Structs§

Enums§

  • Represents an error that may occur when building and sending an image upload request.
  • Represents an error that can occur when building an upload API URL.

Constants§

  • The default host that the Uploads.im service uses in production.

Functions§

  • Builds an upload endpoint URL given some UploadOptions suitable for a multipart form upload to Uploads.im.
  • Uploads an image file denoted by file_path using the given options to the Uploads.im image upload API.
  • Uploads an image file denoted by file_path using default options to the Uploads.im image upload API.

Type Aliases§