snipp-rust
Rust API wrapper for Snipp.
Install
Add to your Cargo.toml:
[]
= { = "../snipp-rust" }
= { = "1", = ["full"] }
Usage
use ;
async
API Reference
All methods are async and return Result<T, SnippError>.
| Method | Description |
|---|---|
get_user(id, options) |
Get a user by ID ("@me" for self). Options: include_posts, posts_limit (1-50). |
upload(path, privacy) |
Upload a file. Privacy: Public, Unlisted, or Private. |
list_uploads() |
List the authenticated user's recent uploads. |
delete_upload(filename) |
Delete an upload by filename. |
discover() |
Browse publicly shared uploads. |
Authentication
All requests require an API key passed to SnippClient::new(). Keys start with snp_ and are sent via the api-key header.
Error Handling
SnippError covers HTTP errors, API errors (non-2xx responses), deserialization failures, and IO errors during file uploads.
License
MIT