---
source_url: https://www.pubnub.com/docs/sdks/rust/api-reference/misc
title: Utility Methods API for Rust SDK
updated_at: 2026-06-16T12:52:32.981Z
sdk_name: PubNub Rust SDK
sdk_version: 0.8.0
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Utility Methods API for Rust SDK

PubNub Rust SDK, use the latest version: 0.8.0

Install:

```bash
cargo add pubnub@0.8.0
```

The methods on this page are utility methods that don't fit into other categories.

## Disconnect

Disconnect from PubNub and pause listening for real-time updates from all data streams. Disconnecting may be temporary and is reversible by [reconnecting](#reconnect). When you disconnect, a cursor of the last received message is saved.

:::warning Client scope
This method is only available on the PubNub object.
:::

### Method(s)

```rust
pubnub.disconnect()
```

### Sample code

```rust
pubnub.disconnect();
```

### Returns

None

## Reconnect

Reconnect to PubNub and resume listening for real-time updates from all data streams. The cursor of the last received message is used for message catch-up between the time you disconnected and reconnected.

:::warning Client scope
This method is only available on the PubNub object.
:::

### Method(s)

```rust
pubnub.reconnect(cursor: Option<SubscriptionCursor>)
```

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| cursor | Option<SubscriptionCursor> | Yes | `Cursor of the last received message before disconnect() was called` | Cursor from which to return any available cached messages. Message retrieval with cursor is not guaranteed and should only be considered a best-effort service. A cursor consists of a timetoken and region: `SubscriptionCursor{timetoken: String, region: u32}` Pass `None` if not needed. |

### Sample code

```rust
pubnub.reconnect(None);
```

### Returns

None