pub struct FileReader(/* private fields */);
Expand description
Implementations§
Source§impl FileReader
impl FileReader
Sourcepub fn new() -> FileReader
pub fn new() -> FileReader
Returns a newly constructed FileReader
.
Sourcepub fn read_as_text<T: IBlob>(&self, blob: &T) -> Result<(), TODO>
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.
Sourcepub fn read_as_array_buffer<T: IBlob>(&self, blob: &T) -> Result<(), TODO>
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.
Sourcepub fn ready_state(&self) -> FileReaderReadyState
pub fn ready_state(&self) -> FileReaderReadyState
Returns the current state of the reader.
Sourcepub fn result(&self) -> Option<FileReaderResult>
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§
Source§impl AsRef<Reference> for FileReader
impl AsRef<Reference> for FileReader
Source§impl Clone for FileReader
impl Clone for FileReader
Source§fn clone(&self) -> FileReader
fn clone(&self) -> FileReader
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FileReader
impl Debug for FileReader
Source§impl From<FileReader> for EventTarget
impl From<FileReader> for EventTarget
Source§fn from(value: FileReader) -> Self
fn from(value: FileReader) -> Self
Converts to this type from the input type.
Source§impl From<FileReader> for Reference
impl From<FileReader> for Reference
Source§fn from(value: FileReader) -> Self
fn from(value: FileReader) -> Self
Converts to this type from the input type.
Source§impl IEventTarget for FileReader
impl IEventTarget for FileReader
Source§fn add_event_listener<T, F>(&self, listener: F) -> EventListenerHandlewhere
T: ConcreteEvent,
F: FnMut(T) + 'static,
fn add_event_listener<T, F>(&self, listener: F) -> EventListenerHandlewhere
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 moreSource§impl InstanceOf for FileReader
impl InstanceOf for FileReader
Source§impl PartialEq for FileReader
impl PartialEq for FileReader
Source§impl ReferenceType for FileReader
impl ReferenceType for FileReader
Source§unsafe fn from_reference_unchecked(reference: Reference) -> Self
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!
Source§impl<'_r> TryFrom<&'_r Reference> for FileReader
impl<'_r> TryFrom<&'_r Reference> for FileReader
Source§impl<'_r> TryFrom<&'_r Value> for FileReader
impl<'_r> TryFrom<&'_r Value> for FileReader
Source§impl TryFrom<EventTarget> for FileReader
impl TryFrom<EventTarget> for FileReader
Source§impl TryFrom<FileReader> for Reference
impl TryFrom<FileReader> for Reference
Source§impl TryFrom<Reference> for FileReader
impl TryFrom<Reference> for FileReader
Source§impl TryFrom<Value> for FileReader
impl TryFrom<Value> for FileReader
impl Eq for FileReader
impl JsSerialize for FileReader
impl StructuralPartialEq for FileReader
Auto Trait Implementations§
impl Freeze for FileReader
impl RefUnwindSafe for FileReader
impl Send for FileReader
impl Sync for FileReader
impl Unpin for FileReader
impl UnwindSafe for FileReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more