pub struct ClientBuilder {
media_storage_dir: Option<PathBuf>,
inner_keypair: Option<Arc<KeyPair>>,
servers: Option<Vec<RelayAddress>>,
db_storage_dir: Option<PathBuf>,
encryption_key: Option<[u8; 32]>,
autoconnect: bool,
}Fields§
§media_storage_dir: Option<PathBuf>§inner_keypair: Option<Arc<KeyPair>>§servers: Option<Vec<RelayAddress>>§db_storage_dir: Option<PathBuf>§encryption_key: Option<[u8; 32]>§autoconnect: boolImplementations§
Source§impl ClientBuilder
impl ClientBuilder
pub fn client_secret(&mut self, secret: ClientSecret)
pub fn media_storage_dir(&mut self, media_storage_dir: String)
pub fn servers(&mut self, servers: Vec<RelayAddress>)
pub fn server_info( &mut self, server_public_key: VerifyingKey, server_addr: SocketAddr, )
Sourcepub fn db_storage_dir(&mut self, path: String)
pub fn db_storage_dir(&mut self, path: String)
Set the storage database path (convenience method)
Sourcepub fn encryption_key(&mut self, key: [u8; 32])
pub fn encryption_key(&mut self, key: [u8; 32])
Set the encryption key for storage
Sourcepub fn autoconnect(&mut self, autoconnect: bool)
pub fn autoconnect(&mut self, autoconnect: bool)
Enable or disable automatic connection to server during build
When autoconnect is true (default for backward compatibility), the client will require server information and connect immediately during build(). When autoconnect is false, the client starts in offline mode and can connect to relays later using add_relay().
pub async fn build(self) -> Result<Client>
Source§impl ClientBuilder
impl ClientBuilder
pub fn media_storage_dir_pathbuf(&mut self, media_storage_dir: PathBuf)
pub fn inner_keypair(&mut self, inner_keypair: KeyPair)
pub fn db_storage_dir_pathbuf(&mut self, path: PathBuf)
Trait Implementations§
Source§impl Default for ClientBuilder
impl Default for ClientBuilder
Source§fn default() -> ClientBuilder
fn default() -> ClientBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnwindSafe for ClientBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more