pub struct BotFarmBuilder { /* private fields */ }Available on crate features
farm and websocket only.Implementations§
Source§impl BotFarmBuilder
impl BotFarmBuilder
pub fn new(name: impl Into<String>, port: u16) -> Self
Sourcepub fn db_prefix(self, prefix: impl Into<String>) -> Self
Available on crate feature cli only.
pub fn db_prefix(self, prefix: impl Into<String>) -> Self
cli only.Path prefix for the SimpleX database
“{dir}/{prefix}” creates a {dir} with {prefix}_agent.db and {prefix}_chat.db;
“{prefix}” creates {prefix}_agent.db and {prefix}_chat.db at the current dir
Sourcepub fn db_key(self, key: impl Into<String>) -> Self
Available on crate feature cli only.
pub fn db_key(self, key: impl Into<String>) -> Self
cli only.Database encryption key.
Sourcepub fn connect_retry_delay(self, delay: Duration) -> Self
pub fn connect_retry_delay(self, delay: Duration) -> Self
Delay between connection retry attempt. Default: 1s
Sourcepub fn cli_args<I, S>(self, args: I) -> Self
Available on crate feature cli only.
pub fn cli_args<I, S>(self, args: I) -> Self
cli only.Pass extra arguments to the simplex-chat process.
Sourcepub async fn connect(self) -> Result<InitFarm, BotInitError>
pub async fn connect(self) -> Result<InitFarm, BotInitError>
Connect to an already-running simplex-chat instance.
Sourcepub async fn launch(self) -> Result<(InitFarm, SimplexCli), BotInitError>
Available on crate feature cli only.
pub async fn launch(self) -> Result<(InitFarm, SimplexCli), BotInitError>
cli only.Spawn simplex-chat, then connect and initialise.
Returns (farm, cli). The caller is responsible for calling
cli::SimplexCli::kill after the farm finishes.
Trait Implementations§
Source§impl Clone for BotFarmBuilder
impl Clone for BotFarmBuilder
Source§fn clone(&self) -> BotFarmBuilder
fn clone(&self) -> BotFarmBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BotFarmBuilder
impl RefUnwindSafe for BotFarmBuilder
impl Send for BotFarmBuilder
impl Sync for BotFarmBuilder
impl Unpin for BotFarmBuilder
impl UnsafeUnpin for BotFarmBuilder
impl UnwindSafe for BotFarmBuilder
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more