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§
- Image
Reference - An abstract struct that encapsulates an image entry on the Uploads.im site.
- Rectangle
- An abstract struct that represents a rectangular area.
- Upload
Options - Models options exposed to users of the upload API.
- Upload
Options Builder - Builder for
UploadOptions
. - Uploaded
Image - Represents a completed image upload to Uploads.im.
Enums§
- Upload
Error - Represents an error that may occur when building and sending an image upload request.
- Upload
RequestURL Build Error - 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 givenoptions
to the Uploads.im image upload API. - upload_
with_ default_ options - Uploads an image file denoted by
file_path
using defaultoptions
to the Uploads.im image upload API.
Type Aliases§
- Full
Size Dimension - The integral type that full image dimensions use.
- Thumbnail
Dimension - The integral type that thumbnail image dimensions use.