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§

ImageReference
An abstract struct that encapsulates an image entry on the Uploads.im site.
Rectangle
An abstract struct that represents a rectangular area.
UploadOptions
Models options exposed to users of the upload API.
UploadOptionsBuilder
Builder for UploadOptions.
UploadedImage
Represents a completed image upload to Uploads.im.

Enums§

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

Constants§

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

Functions§

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

Type Aliases§

FullSizeDimension
The integral type that full image dimensions use.
ThumbnailDimension
The integral type that thumbnail image dimensions use.