Function gloo::file::callbacks::read_as_bytes

source ·
pub fn read_as_bytes<F>(blob: &Blob, callback: F) -> FileReaderwhere
    F: FnOnce(Result<Vec<u8, Global>, FileReadError>) + 'static,
Available on crate feature file only.
Expand description

Asynchronously converts the blob into a Vec<u8> and then passes it to the callback.

If the returned FileReader is dropped before the callback is called, the read will be cancelled.