# IStorageProvider

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/platform/storage/trait-istorageprovider/

**trait** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
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.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L16)

## Members

- [`can_open`](#function-can_open)
- [`open_file_picker_async`](#function-open_file_picker_async)
- [`open_file_picker_with_result_async`](#function-open_file_picker_with_result_async)
- [`can_save`](#function-can_save)
- [`save_file_picker_async`](#function-save_file_picker_async)
- [`save_file_picker_with_result_async`](#function-save_file_picker_with_result_async)
- [`can_pick_folder`](#function-can_pick_folder)
- [`open_folder_picker_async`](#function-open_folder_picker_async)
- [`open_file_bookmark_async`](#function-open_file_bookmark_async)
- [`open_folder_bookmark_async`](#function-open_folder_bookmark_async)
- [`try_get_file_from_path_async`](#function-try_get_file_from_path_async)
- [`try_get_folder_from_path_async`](#function-try_get_folder_from_path_async)
- [`try_get_well_known_folder_async`](#function-try_get_well_known_folder_async)
- [`is_file_system_backed`](#function-is_file_system_backed)

<a id="function-can_open"></a>

### can_open

```rust
fn can_open(self: &Self) -> bool
```

Returns `true` if it is possible to open a file picker on the
current platform.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L19)

<a id="function-open_file_picker_async"></a>

### open_file_picker_async

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L25)

<a id="function-open_file_picker_with_result_async"></a>

### open_file_picker_with_result_async

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L35)

<a id="function-can_save"></a>

### can_save

```rust
fn can_save(self: &Self) -> bool
```

Returns `true` if it is possible to open a save file picker on the
current platform.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L42)

<a id="function-save_file_picker_async"></a>

### save_file_picker_async

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L48)

<a id="function-save_file_picker_with_result_async"></a>

### save_file_picker_with_result_async

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L58)

<a id="function-can_pick_folder"></a>

### can_pick_folder

```rust
fn can_pick_folder(self: &Self) -> bool
```

Returns `true` if it is possible to open a folder picker on the
current platform.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L65)

<a id="function-open_folder_picker_async"></a>

### open_folder_picker_async

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L71)

<a id="function-open_file_bookmark_async"></a>

### open_file_bookmark_async

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L80)

<a id="function-open_folder_bookmark_async"></a>

### open_folder_bookmark_async

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L86)

<a id="function-try_get_file_from_path_async"></a>

### try_get_file_from_path_async

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L94)

<a id="function-try_get_folder_from_path_async"></a>

### try_get_folder_from_path_async

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L102)

<a id="function-try_get_well_known_folder_async"></a>

### try_get_well_known_folder_async

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L106)

<a id="function-is_file_system_backed"></a>

### is_file_system_backed

```rust
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`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/storage/i_storage_provider.rs#L116)

## Trait implementations

- [`IStorageProvider`](/docs/0.5.0/api/ferroui-base/platform/storage/trait-istorageprovider/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
