#file-loading #async #load-file #browser #desktop #api #serve #byte #desktop-and-web #uniform

platter

Provide a uniform async interface for file loading between desktop and browser

5 releases

0.2.0-alpha0 Jun 14, 2025
0.1.4 Dec 22, 2019
0.1.1 Oct 25, 2019

#558 in Filesystem

Download history 135/week @ 2025-03-25 43/week @ 2025-04-01 67/week @ 2025-04-08 44/week @ 2025-04-15 167/week @ 2025-04-22 143/week @ 2025-04-29 62/week @ 2025-05-06 27/week @ 2025-05-13 24/week @ 2025-05-20 30/week @ 2025-05-27 24/week @ 2025-06-03 145/week @ 2025-06-10 118/week @ 2025-06-17 124/week @ 2025-06-24 36/week @ 2025-07-01 130/week @ 2025-07-08

423 downloads per month
Used in 4 crates (2 directly)

MIT OR Apache-2.0 OR Zlib

7KB
91 lines

A simple utility to serve you files on a platter

platter works on both desktop and web, and returns a byte buffer of the file's contents. On desktop, load_file is backed by native file system APIs. On web, it is backed by an HTTP 'GET' request.

To use platter on the web, you'll need to choose either the stdweb or web-sys feature and enable it. This determines which method of binding to browser APIs platter will use.


platter

A simple utility to serve you files on a platter

platter works on both desktop and web, and returns a byte buffer of the file's contents. On desktop, load_file is backed by native file system APIs. On web, it is backed by an HTTP 'GET' request.

let file_contents = load_file("path_to_my_file").await?;

Dependencies

~0.5–3MB
~56K SLoC