[][src]Struct stdweb::web::FileReader

pub struct FileReader(_);

The FileReader object lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read.

(JavaScript docs)

Methods

impl FileReader[src]

pub fn new() -> FileReader[src]

Returns a newly constructed FileReader.

(JavaScript docs)

pub fn read_as_text<T: IBlob>(&self, blob: &T) -> Result<(), TODO>[src]

Starts reading the contents of the specified blob. Once finished the result attribute will contain the contents of the file as a text string.

(JavaScript docs)

pub fn read_as_array_buffer<T: IBlob>(&self, blob: &T) -> Result<(), TODO>[src]

Starts reading the contents of the specified blob. Once finished the result attribute will contain the contents of the file as an TypedArray.

(JavaScript docs)

pub fn abort(&self)[src]

Aborts the read operation. Upon return, the ready_state will be Done.

(JavaScript docs)

pub fn ready_state(&self) -> FileReaderReadyState[src]

Returns the current state of the reader.

(JavaScript docs)

pub fn result(&self) -> Option<FileReaderResult>[src]

The file's contents. This method will only return a value after the read operation is complete, and the format of the data depends on which of the methods was used to initiate the read operation.

(JavaScript docs)

Trait Implementations

impl JsSerialize for FileReader[src]

impl TryFrom<EventTarget> for FileReader[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<FileReader> for Reference[src]

type Error = Void

The type returned in the event of a conversion error.

impl TryFrom<Reference> for FileReader[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Reference> for FileReader[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Value> for FileReader[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Value> for FileReader[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl InstanceOf for FileReader[src]

impl ReferenceType for FileReader[src]

impl IEventTarget for FileReader[src]

impl AsRef<Reference> for FileReader[src]

impl From<FileReader> for EventTarget[src]

impl From<FileReader> for Reference[src]

impl Clone for FileReader[src]

impl Eq for FileReader[src]

impl PartialEq<FileReader> for FileReader[src]

impl Debug for FileReader[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]