# ProjectWorkspace

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-designer-project/struct-projectworkspace/

**struct** · [`ferroui-designer-project`](/docs/0.5.0/api/ferroui-designer-project/) · v0.5.0

```rust
struct ProjectWorkspace
```



[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L56)

## Members

- [`solution`](#struct_field-solution)
- [`new`](#function-new)
- [`buffers`](#function-buffers)
- [`buffer`](#function-buffer)
- [`active_uri`](#function-active_uri)
- [`activate`](#function-activate)
- [`open`](#function-open)
- [`create`](#function-create)
- [`update_source`](#function-update_source)
- [`apply_updates`](#function-apply_updates)
- [`store_document`](#function-store_document)
- [`save`](#function-save)
- [`acknowledge_saved`](#function-acknowledge_saved)
- [`save_with_policy`](#function-save_with_policy)
- [`save_as`](#function-save_as)
- [`close`](#function-close)
- [`reload`](#function-reload)
- [`rename_document`](#function-rename_document)
- [`register_resource`](#function-register_resource)
- [`resolve_path`](#function-resolve_path)

<a id="struct_field-solution"></a>

### solution

```rust
solution: crate::Solution
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L57)

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

### new

```rust
fn new(solution: Solution) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L63)

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

### buffers

```rust
fn buffers(self: &Self) -> impl Iterator<Item = &Buffer>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L71)

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

### buffer

```rust
fn buffer(self: &Self, uri: &str) -> Option<&Buffer>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L74)

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

### active_uri

```rust
fn active_uri(self: &Self) -> Option<&str>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L79)

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

### activate

```rust
fn activate(self: &mut Self, uri: &str) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L82)

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

### open

```rust
fn open(self: &mut Self, uri: &str) -> Result<&Buffer>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L88)

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

### create

```rust
fn create(self: &mut Self, uri: impl Into<String>, source: impl Into<String>) -> Result<&Buffer>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L111)

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

### update_source

```rust
fn update_source(self: &mut Self, uri: &str, expected_version: u64, source: impl Into<String>) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L141)

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

### apply_updates

```rust
fn apply_updates(self: &mut Self, updates: Vec<BufferUpdate>) -> Result<()>
```

Validate all versions and candidates before committing any buffer in a refactoring.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L154)

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

### store_document

```rust
fn store_document(self: &mut Self, uri: &str, expected_version: u64, document: Document) -> Result<()>
```

Preserve the native designer's complete undo/redo history when storing an inactive tab.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L191)

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

### save

```rust
fn save(self: &mut Self, uri: &str) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L211)

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

### acknowledge_saved

```rust
fn acknowledge_saved(self: &mut Self, uri: &str, expected_version: u64, saved_source: impl Into<String>) -> Result<()>
```

Record a successful host/provider save without IO or resetting tab history. The
saved snapshot may predate current authored text after an asynchronous write.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L216)

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

### save_with_policy

```rust
fn save_with_policy(self: &mut Self, uri: &str, policy: SavePolicy) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L237)

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

### save_as

```rust
fn save_as(self: &mut Self, uri: &str, path: impl AsRef<Path>) -> Result<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L269)

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

### close

```rust
fn close(self: &mut Self, uri: &str, discard: bool) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L295)

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

### reload

```rust
fn reload(self: &mut Self, uri: &str, discard: bool) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L311)

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

### rename_document

```rust
fn rename_document(self: &mut Self, uri: &str, new_path: impl AsRef<Path>) -> Result<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L334)

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

### register_resource

```rust
fn register_resource(self: &mut Self, uri: impl Into<String>, path: impl AsRef<Path>) -> Result<()>
```

Register a host-defined embedded-resource key without allowing it to bypass root checks.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L359)

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

### resolve_path

```rust
fn resolve_path(self: &Self, uri: &str) -> Result<PathBuf>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Project/workspace.rs#L373)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `Clone`

## Availability

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