Skip to content

Struct ClientBuilder

zaun_client::ClientBuilder · Struct

pub struct ClientBuilder { … }

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

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

The SimpleX profile name a new store starts with.

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

The store passphrase.

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).

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

Where the SimpleX client logs (stderr by default).

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

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

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

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

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

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

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

Starts the SimpleX client and reconnects every saved community.

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

Full rustdoc page