Skip to main content

snipp-gg/snipp-rust

crates.io/crates/snipp

Installation

Add to your Cargo.toml:

Getting Started

Methods

All methods are async and return Result<T, SnippError>.

get_user(id, options)

Fetch a user by ID. Pass "@me" for the authenticated user.

get_post(code)

Fetch a post by its share code.

upload(path, options)

Upload a file from disk.

list_uploads(limit)

List the authenticated user’s recent uploads. Pass Some(N) for limit to control the count (max 1000), or None for the default (30).

edit_upload(code, options)

Edit an existing upload’s title, description, or privacy.

append_upload(code, file_paths)

Add one or more files to an existing album post. The post’s share code, privacy, title, and description are preserved. Albums cap at 9 files total. Requests that would exceed the cap are rejected. New files inherit the post’s privacy. Returned URLs are signed with a 24-hour expiry for private posts.

delete_upload(filename)

Delete an upload by its filename. On albums, only that file is removed; on single-file posts the entire post is deleted.

Error Handling

All errors are returned as SnippError, which covers API errors, HTTP errors, deserialization failures, and IO errors.