[−][src]Struct rfd::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
Auto Trait Implementations
impl RefUnwindSafe for FileHandle
[src]
impl Send for FileHandle
[src]
impl Sync for FileHandle
[src]
impl Unpin for FileHandle
[src]
impl UnwindSafe for FileHandle
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,