[][src]Struct rfd::FileHandle

pub struct FileHandle(_);

FileHandle is a way of abstracting over a file returned by a dialog

Implementations

impl FileHandle[src]

pub fn wrap(path_buf: PathBuf) -> Self[src]

On native platforms it wraps path.

On WASM32 it wraps JS File object.

pub fn file_name(&self) -> String[src]

Get name of a file

pub fn path(&self) -> &Path[src]

Gets path to a file.

Does not exist in WASM32

pub async fn read(&self) -> Vec<u8>[src]

Reads a file asynchronously.

On native platforms it spawns a std::thread in the background.

This fn exists souly to keep native api in pair with async only web api.

pub fn inner(&self) -> &Path[src]

Unwraps a FileHandle and returns innet type.

It should be used, if user wants to handle file read themselves

On native platforms returns path.

On WASM32 it returns JS File object.

Behind a file-handle-inner feature flag

Trait Implementations

impl Debug for FileHandle[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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.