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.
Methods
Section titled “Methods”pub fn name<impl Into<String>>(self, name: impl Into<String>) -> SelfThe SimpleX profile name a new store starts with.
pub fn key<impl Into<String>>(self, key: impl Into<String>) -> SelfThe store passphrase.
pub fn relay<impl Into<String>>(self, address: impl Into<String>) -> SelfAdds 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) -> SelfWhere the SimpleX client logs (stderr by default).
timeout
Section titled “timeout”pub const fn timeout(self, timeout: Duration) -> SelfHow long a command waits for the host’s answer (60 s by default).
join_timeout
Section titled “join_timeout”pub const fn join_timeout(self, timeout: Duration) -> SelfHow long a join or a community creation may take, connection included (120 s).
transfer_timeout
Section titled “transfer_timeout”pub const fn transfer_timeout(self, timeout: Duration) -> SelfHow 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.
Errors
Section titled “Errors”The SimpleX client failed to start (wrong passphrase, unreadable store).