# Struct ClientBuilder

> Configures a `Client`. The directory holds the SimpleX store and `zaun/`, the community keys and state; give every client its own.

`zaun_client::ClientBuilder` · Struct

```rust
pub struct ClientBuilder { … }
```

Configures a `Client`. The directory holds the SimpleX store and `zaun/`, the community
keys and state; give every client its own.

## Methods

### `name`

```rust
pub fn name<impl Into<String>>(self, name: impl Into<String>) -> Self
```

The SimpleX profile name a new store starts with.

### `key`

```rust
pub fn key<impl Into<String>>(self, key: impl Into<String>) -> Self
```

The store passphrase.

### `relay`

```rust
pub fn relay<impl Into<String>>(self, address: impl Into<String>) -> Self
```

Adds a relay: an SMP server (`smp://…`) or an XFTP file server (`xftp://…`). With no
SMP server the official SimpleX servers are used, and with them the official file
servers unless an `xftp://` one is given. Uploads go only to these file servers, so
they must be among the ones a community's host downloads from
(`CommunityData::attachments`).

### `log`

```rust
pub fn log<impl Write + Send + 'static>(self, sink: impl Write + Send + 'static) -> Self
```

Where the SimpleX client logs (stderr by default).

### `timeout`

```rust
pub const fn timeout(self, timeout: Duration) -> Self
```

How long a command waits for the host's answer (60 s by default).

### `join_timeout`

```rust
pub const fn join_timeout(self, timeout: Duration) -> Self
```

How long a join or a community creation may take, connection included (120 s).

### `transfer_timeout`

```rust
pub const fn transfer_timeout(self, timeout: Duration) -> Self
```

How long an attachment upload or download may take (10 minutes by default).

### `start`

```rust
pub fn start(self) -> Result<Client>
```

Starts the SimpleX client and reconnects every saved community.

# Errors
The SimpleX client failed to start (wrong passphrase, unreadable store).

[Full rustdoc page](/docs/api/rust/zaun-client/zaun_client/builder/struct.ClientBuilder.html)
