Skip to content

SternPhD/tus-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tus-rs

Rust implementation of TUS protocol for resumable uploads.

Heavily influenced by:

Usage

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;

About

Rust implementation of the TUS Protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages