# Browser

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-devtools/struct-browser/

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

```rust
struct Browser
```

UI-thread target registry and flattened CDP session router, shared by the native server and
browser bridge. Window and popup discovery follows the desktop application lifetime.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DevTools/browser.rs#L31)

## Members

- [`new`](#function-new)
- [`register`](#function-register)
- [`refresh`](#function-refresh)
- [`discovery`](#function-discovery)
- [`version`](#function-version)
- [`connect`](#function-connect)
- [`disconnect`](#function-disconnect)
- [`handle`](#function-handle)
- [`poll`](#function-poll)

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

### new

```rust
fn new() -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DevTools/browser.rs#L46)

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

### register

```rust
fn register(self: &mut Self, root: &Ref<TopLevel>) -> String
```

Explicit registration also supports custom lifetimes. The registry retains only a weak root.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DevTools/browser.rs#L57)

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

### refresh

```rust
fn refresh(self: &mut Self)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DevTools/browser.rs#L80)

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

### discovery

```rust
fn discovery(self: &mut Self, port: u16) -> Value
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DevTools/browser.rs#L127)

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

### version

```rust
fn version(port: u16) -> Value
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DevTools/browser.rs#L134)

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

### connect

```rust
fn connect(self: &mut Self, target: Option<&str>) -> std::result::Result<u64, String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DevTools/browser.rs#L137)

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

### disconnect

```rust
fn disconnect(self: &mut Self, connection: u64)
```



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

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

### handle

```rust
fn handle(self: &mut Self, connection: u64, message: &str) -> Vec<Value>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DevTools/browser.rs#L168)

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

### poll

```rust
fn poll(self: &mut Self, connection: u64) -> Vec<Value>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DevTools/browser.rs#L385)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Same`
- `VZip<V>`
- `CastableFrom<ST, Uninit, Uninit>`
- `CastableFrom<ST, Initialized, Initialized>`
- `Read<Exclusive, BecauseExclusive>`
- `Default`

## Availability

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