[][src]Function platter::load_file

pub fn load_file(
    path: impl AsRef<Path>
) -> impl Future<Output = Result<Vec<u8>, IOError>>

Create a Future that loads a file into an owned Vec of bytes

It exists for loading files from the server with Javascript on the web, and providing a unified API between desktop and the web when it comes to file loading.

On desktop, the file will be loaded from disk relative to the current directory, and the Future will return instantly. On the web, a GET request will be made to the stringified version of the path and the Future will return when the HTTP request resolves.