gloo_file::callbacks

Function read_as_text

Source
pub fn read_as_text<F>(blob: &Blob, callback: F) -> FileReader
where F: FnOnce(Result<String, FileReadError>) + 'static,
Expand description

Asynchronously converts blob into a text string and then passes it to the callback.

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