IStorageProvider
trait · ferroui-base · v0.5.0
trait IStorageProvider
Opens file and folder pickers and gives access to storage items.
The picker operations fail with an I/O error when no picker can be shown.
This interface is not meant to be implemented by applications.
Members
can_openopen_file_picker_asyncopen_file_picker_with_result_asynccan_savesave_file_picker_asyncsave_file_picker_with_result_asynccan_pick_folderopen_folder_picker_asyncopen_file_bookmark_asyncopen_folder_bookmark_asynctry_get_file_from_path_asynctry_get_folder_from_path_asynctry_get_well_known_folder_asyncis_file_system_backed
can_open
fn can_open(self: &Self) -> bool
Returns true if it is possible to open a file picker on the
current platform.
open_file_picker_async
fn open_file_picker_async(self: &Self, options: FilePickerOpenOptions) -> LocalBoxFuture<std::io::Result<Vec<Rc<dyn IStorageFile>>>>
Opens a file picker dialog.
Resolves to the list of files, empty if the user canceled the dialog.
open_file_picker_with_result_async
fn open_file_picker_with_result_async(self: &Self, options: FilePickerOpenOptions) -> LocalBoxFuture<std::io::Result<OpenFilePickerResult>>
Opens a file picker dialog and returns the selected files along with additional information.
This method allows retrieving additional details about the picked files, such as the selected file type.
can_save
fn can_save(self: &Self) -> bool
Returns true if it is possible to open a save file picker on the
current platform.
save_file_picker_async
fn save_file_picker_async(self: &Self, options: FilePickerSaveOptions) -> LocalBoxFuture<std::io::Result<Option<Rc<dyn IStorageFile>>>>
Opens a save file picker dialog.
Resolves to the saved IStorageFile, or None if the user
canceled the dialog.
save_file_picker_with_result_async
fn save_file_picker_with_result_async(self: &Self, options: FilePickerSaveOptions) -> LocalBoxFuture<std::io::Result<SaveFilePickerResult>>
Opens a save file picker dialog and returns the selected file along with additional information.
This method allows retrieving additional details about the saved file, such as the selected file type.
can_pick_folder
fn can_pick_folder(self: &Self) -> bool
Returns true if it is possible to open a folder picker on the
current platform.
open_folder_picker_async
fn open_folder_picker_async(self: &Self, options: FolderPickerOpenOptions) -> LocalBoxFuture<std::io::Result<Vec<Rc<dyn IStorageFolder>>>>
Opens a folder picker dialog.
Resolves to the list of folders, empty if the user canceled the dialog.
open_file_bookmark_async
fn open_file_bookmark_async(self: &Self, bookmark: &str) -> LocalBoxFuture<Option<Rc<dyn IStorageBookmarkFile>>>
Opens an IStorageBookmarkFile from the bookmark ID.
Resolves to the bookmarked file, or None if the OS denied the
request or the bookmark is invalid.
open_folder_bookmark_async
fn open_folder_bookmark_async(self: &Self, bookmark: &str) -> LocalBoxFuture<Option<Rc<dyn IStorageBookmarkFolder>>>
Opens an IStorageBookmarkFolder from the bookmark ID.
Resolves to the bookmarked folder, or None if the OS denied the
request or the bookmark is invalid.
try_get_file_from_path_async
fn try_get_file_from_path_async(self: &Self, file_path: &Url) -> LocalBoxFuture<Option<Rc<dyn IStorageFile>>>
Attempts to read a file from the file-system by its path.
file_path is the path of the item to retrieve in URI format.
The URI must be an absolute path. It also might ask the user for a
permission, and resolve to None if it was denied.
try_get_folder_from_path_async
fn try_get_folder_from_path_async(self: &Self, folder_path: &Url) -> LocalBoxFuture<Option<Rc<dyn IStorageFolder>>>
Attempts to read a folder from the file-system by its path.
folder_path is the path of the folder to retrieve in URI format.
The URI must be an absolute path. It also might ask the user for a
permission, and resolve to None if it was denied.
try_get_well_known_folder_async
fn try_get_well_known_folder_async(self: &Self, well_known_folder: WellKnownFolder) -> LocalBoxFuture<Option<Rc<dyn IStorageFolder>>>
Attempts to read a folder from the file-system by its well-known folder identifier.
is_file_system_backed
fn is_file_system_backed(self: &Self) -> bool
Whether the provider is the file-system backed one
(C# provider is BclStorageProvider).
Answered with true by the implementations of
BclStorageProvider.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.