Struct stdweb::web::FileReader [−][src]
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.
Methods
impl FileReader
[src]
impl FileReader
pub fn new() -> FileReader
[src]
pub fn new() -> FileReader
Returns a newly constructed FileReader
.
pub fn read_as_text<T: IBlob>(&self, blob: &T) -> Result<(), TODO>
[src]
pub fn read_as_text<T: IBlob>(&self, blob: &T) -> Result<(), TODO>
Starts reading the contents of the specified blob. Once finished
the result
attribute will contain the contents of the file as a text string.
pub fn read_as_array_buffer<T: IBlob>(&self, blob: &T) -> Result<(), TODO>
[src]
pub fn read_as_array_buffer<T: IBlob>(&self, blob: &T) -> Result<(), TODO>
Starts reading the contents of the specified blob. Once finished
the result
attribute will contain the contents of the file as an TypedArray.
pub fn abort(&self)
[src]
pub fn abort(&self)
Aborts the read operation. Upon return, the ready_state
will be Done
.
pub fn ready_state(&self) -> FileReaderReadyState
[src]
pub fn ready_state(&self) -> FileReaderReadyState
Returns the current state of the reader.
pub fn result(&self) -> Option<FileReaderResult>
[src]
pub fn result(&self) -> Option<FileReaderResult>
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.
Trait Implementations
impl Clone for FileReader
[src]
impl Clone for FileReader
fn clone(&self) -> FileReader
[src]
fn clone(&self) -> FileReader
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for FileReader
[src]
impl Debug for FileReader
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for FileReader
[src]
impl PartialEq for FileReader
fn eq(&self, other: &FileReader) -> bool
[src]
fn eq(&self, other: &FileReader) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &FileReader) -> bool
[src]
fn ne(&self, other: &FileReader) -> bool
This method tests for !=
.
impl Eq for FileReader
[src]
impl Eq for FileReader
impl From<FileReader> for EventTarget
[src]
impl From<FileReader> for EventTarget
fn from(value: FileReader) -> Self
[src]
fn from(value: FileReader) -> Self
Performs the conversion.
impl TryFrom<EventTarget> for FileReader
[src]
impl TryFrom<EventTarget> for FileReader
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: EventTarget) -> Result<Self, Self::Error>
[src]
fn try_from(value: EventTarget) -> Result<Self, Self::Error>
Performs the conversion.
impl InstanceOf for FileReader
[src]
impl InstanceOf for FileReader
fn instance_of(reference: &Reference) -> bool
[src]
fn instance_of(reference: &Reference) -> bool
Checks whenever a given Reference if of type Self
.
impl AsRef<Reference> for FileReader
[src]
impl AsRef<Reference> for FileReader
impl ReferenceType for FileReader
[src]
impl ReferenceType for FileReader
unsafe fn from_reference_unchecked(reference: Reference) -> Self
[src]
unsafe fn from_reference_unchecked(reference: Reference) -> Self
Converts a given reference into a concrete reference-like wrapper. Doesn't do any type checking; highly unsafe to use! Read more
impl From<FileReader> for Reference
[src]
impl From<FileReader> for Reference
fn from(value: FileReader) -> Self
[src]
fn from(value: FileReader) -> Self
Performs the conversion.
impl TryFrom<FileReader> for Reference
[src]
impl TryFrom<FileReader> for Reference
type Error = Void
The type returned in the event of a conversion error.
fn try_from(value: FileReader) -> Result<Self, Self::Error>
[src]
fn try_from(value: FileReader) -> Result<Self, Self::Error>
Performs the conversion.
impl TryFrom<Reference> for FileReader
[src]
impl TryFrom<Reference> for FileReader
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: Reference) -> Result<Self, Self::Error>
[src]
fn try_from(reference: Reference) -> Result<Self, Self::Error>
Performs the conversion.
impl<'_r> TryFrom<&'_r Reference> for FileReader
[src]
impl<'_r> TryFrom<&'_r Reference> for FileReader
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: &Reference) -> Result<Self, Self::Error>
[src]
fn try_from(reference: &Reference) -> Result<Self, Self::Error>
Performs the conversion.
impl TryFrom<Value> for FileReader
[src]
impl TryFrom<Value> for FileReader
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Self, Self::Error>
[src]
fn try_from(value: Value) -> Result<Self, Self::Error>
Performs the conversion.
impl<'_r> TryFrom<&'_r Value> for FileReader
[src]
impl<'_r> TryFrom<&'_r Value> for FileReader
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<Self, Self::Error>
[src]
fn try_from(value: &Value) -> Result<Self, Self::Error>
Performs the conversion.
impl JsSerialize for FileReader
[src]
impl JsSerialize for FileReader
impl IEventTarget for FileReader
[src]
impl IEventTarget for FileReader
fn add_event_listener<T, F>(&self, listener: F) -> EventListenerHandle where
T: ConcreteEvent,
F: FnMut(T) + 'static,
[src]
fn add_event_listener<T, F>(&self, listener: F) -> EventListenerHandle where
T: ConcreteEvent,
F: FnMut(T) + 'static,
Adds given event handler to the list of event listeners for the specified EventTarget
on which it's called. Read more
fn dispatch_event<T: IEvent>(&self, event: &T) -> Result<bool, TODO>
[src]
fn dispatch_event<T: IEvent>(&self, event: &T) -> Result<bool, TODO>
Dispatches an Event
at this EventTarget
, invoking the affected event listeners in the appropriate order. Read more
Auto Trait Implementations
impl Send for FileReader
impl Send for FileReader
impl Sync for FileReader
impl Sync for FileReader