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§
- auth
- Authentication helper utilities
- client
- constants
- Library-specific constants
- file
- file_
stream - https
- Module to resolve the HTTPS Connector / Client used to make requests, depending on which TLS implementation we want to use.
- link
- models
- status
- Utilities to validate a response to ensure that its status code indicates that it is a success.
- types
- Library-specific type definitions
- utils
- Library-specific utilities, mainly for internal use.
Structs§
- Data
Client - File
Uploader - Client implementation to upload files and videos via the Wistia Upload API.
- Stream
Uploader - Client implementation to upload streams (file-like objects) and videos via the Wistia Upload API.
- Upload
Client - Client used to make requests to the Wistia Upload API.
- UrlUploader
- Client implementation to upload URL links to media files via the Wistia Upload API.