Rust implementation of TUS protocol for resumable uploads.
Heavily influenced by:
Create a resource
let path = PathBuf::from_str("/path/to/file")?;
let client = Client::new();
let host = Url::parse(TUS_ENDPOINT).unwrap();
let upload_metadata = client.create(&path, &host, None, None).await?;Resume the upload
let client = Client::new();
let host = Url::parse(TUS_ENDPOINT).unwrap();
let upload_metadata = // get metadata from the `create` function, or disk/memory
let upload_metadata = client.resume(&upload_metadata).await?;Create and upload a file same time
let path = PathBuf::from_str("/path/to/file")?;
let client = Client::new();
let host = Url::parse(TUS_ENDPOINT).unwrap();
let extra_metadata = Some(HashMap::<String,String>::new());
let custom_headers = None;
let result = client.upload(&path, &host, extra_metadata, custom_headers).await;