Crate rust_wistia
source ·Expand description
An async Rust library implementation to interact with the Wistia API.
Example
use rust_wistia::UrlUploader;
#[tokio::main]
async fn main() -> std::result::Result<(), Box<dyn std::error::Error + Send + Sync>> {
let res = UrlUploader::new("my-url-link")?
.name("My Video Name")
.send()
.await?;
println!("Response: {res:#?}");
// Print out some useful attributes
println!("Video ID: {}", res.hashed_id);
Ok(())
}
Dependencies and Features
This library uses only the minimum required dependencies, in order to keep the overall size small. This crate uses hyper and hyper-rustls internally, to make HTTPS requests to the Wistia API.
While hyper-rustls
was chosen as the default TLS implementation
because it works without issue when cross-compiling for the
x86_64-unknown-linux-musl target as is common for AWS Lambda
deployments, it is still possible to instead use the native hyper-tls
implementation, which relies on OpenSSL.
To do this, disable the default “rust-tls” feature and enable the “native-tls” feature:
[dependencies]
rust-wistia = { version = "0.8", default-features = false, features = ["native-tls", "logging", "serde-std"] }
Re-exports
Modules
- Authentication helper utilities
- Library-specific constants
- Module to resolve the HTTPS Connector / Client used to make requests, depending on which TLS implementation we want to use.
- Utilities to validate a response to ensure that its status code indicates that it is a success.
- Library-specific type definitions
- Library-specific utilities, mainly for internal use.
Structs
- Client implementation to upload files and videos via the Wistia Upload API.
- Client implementation to upload streams (file-like objects) and videos via the Wistia Upload API.
- Client used to make requests to the Wistia Upload API.
- Client implementation to upload URL links to media files via the Wistia Upload API.