# CdpSession

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

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

```rust
struct CdpSession
```

A transport-independent CDP connection to a single top-level. All calls run on its UI thread.
`handle` returns the response followed by any events; call `poll` for asynchronous events.

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

## Members

- [`new`](#function-new)
- [`handle`](#function-handle)
- [`poll`](#function-poll)

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

### new

```rust
fn new(root: &Ref<TopLevel>, target_id: impl Into<String>) -> Self
```



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

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

### handle

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



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

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

### poll

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

Poll on the UI thread, typically every 100 ms. Tree changes invalidate the document.

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

## 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>`
- `Drop`

## Availability

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