# Router

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-view/router/struct-router/

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

```rust
struct Router
```

The router of the nearest [`router`](/docs/0.5.0/api/ferroui-view/router/function-router/) above: its stack of paths, read
reactively and changed by navigation. A handle: `Copy`, cheap to clone,
and given to handlers as it is.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/router.rs#L152)

## Members

- [`navigate`](#function-navigate)
- [`navigate_back`](#function-navigate_back)
- [`navigate_and_reset`](#function-navigate_and_reset)
- [`current`](#function-current)
- [`can_go_back`](#function-can_go_back)
- [`stack`](#function-stack)

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

### navigate

```rust
fn navigate(self: &Self, path: &str)
```

Shows the view of `path`, and puts it on the stack (`Navigate`).
Nothing happens once the router was taken out.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/router.rs#L165)

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

### navigate_back

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

Goes back to the path before the current one, taking the current one
off the stack (`NavigateBack`); false when the stack holds one path
only, which stays.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/router.rs#L174)

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

### navigate_and_reset

```rust
fn navigate_and_reset(self: &Self, path: &str)
```

Shows the view of `path` with a stack that holds `path` alone
(`NavigateAndReset`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/router.rs#L186)

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

### current

```rust
fn current(self: &Self) -> String
```

The current path: the last of the stack. Reading it makes the reader
(a component, a memo, a property) follow it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/router.rs#L194)

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

### can_go_back

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

Whether there is a path to go back to; reactive.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/router.rs#L199)

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

### stack

```rust
fn stack(self: &Self) -> Vec<String>
```

The paths of the stack, the current one last (`NavigationStack`);
reactive.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/router.rs#L205)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`IntoValue<T>`](/docs/0.5.0/api/ferroui-view/builder/trait-intovalue/)
- [`IntoValue<Option<T>>`](/docs/0.5.0/api/ferroui-view/builder/trait-intovalue/)
- [`FromValue<T>`](/docs/0.5.0/api/ferroui-view/builder/trait-fromvalue/)
- [`FromValue<Option<T>>`](/docs/0.5.0/api/ferroui-view/builder/trait-fromvalue/)
- [`IntoProp<T, Value>`](/docs/0.5.0/api/ferroui-view/builder/trait-intoprop/)
- [`AnyValueEq`](/docs/0.5.0/api/ferroui-view/element/trait-anyvalueeq/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`TreeModel`](/docs/0.5.0/api/ferroui-treedatagrid-core/accessor/trait-treemodel/)
- `Clone`
- `Copy`
- `StructuralPartialEq`
- `PartialEq`
- `Debug`

## Availability

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