Skip to main content

FileStream

Trait FileStream 

Source
pub trait FileStream {
    // Required methods
    fn name(&self) -> &str;
    fn url(&self) -> String;
    fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> FileReadFuture<'a>;
}
Expand description

A picked file that can only be read through, once, start to end.

Required Methods§

Source

fn name(&self) -> &str

Source

fn url(&self) -> String

The URL the system reads the file by (PickedFile::url).

Source

fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> FileReadFuture<'a>

Reads the next bytes into buf; answers how many, 0 at the end.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§