pub struct BotBuilder { /* private fields */ }Available on crate feature
ffi only.Expand description
Builder for an FFI-backed Bot.
Implementations§
Source§impl BotBuilder
impl BotBuilder
Sourcepub fn with_default_user(self, user: DefaultUser) -> Self
pub fn with_default_user(self, user: DefaultUser) -> Self
Override the default user created for empty databases.
By default the default user name matches the bot name. This setting allows to create a user different from an active bot
Sourcepub fn auto_accept(self) -> Self
pub fn auto_accept(self) -> Self
Create public address and auto accept users
Sourcepub fn auto_accept_with(self, welcome_message: impl Into<String>) -> Self
pub fn auto_accept_with(self, welcome_message: impl Into<String>) -> Self
Self::auto_accept with a welcome message
Sourcepub fn with_avatar(self, avatar: ImagePreview) -> Self
pub fn with_avatar(self, avatar: ImagePreview) -> Self
Set the bot avatar during initialisation
Sourcepub fn with_profile(self, profile: Profile) -> Self
pub fn with_profile(self, profile: Profile) -> Self
Update/create the whole bot profile on launch
Sourcepub fn with_preferences(self, prefs: Preferences) -> Self
pub fn with_preferences(self, prefs: Preferences) -> Self
Apply these preferences to the bot’s profile during initialisation.
Sourcepub fn max_event_latency(self, latency: Duration) -> Self
pub fn max_event_latency(self, latency: Duration) -> Self
Set max permissible event latency. See WorkerConfig::max_event_latency for details
Sourcepub fn max_instances(self, instances: usize) -> Self
pub fn max_instances(self, instances: usize) -> Self
Set max concurrent SimpleX-Chat instances. See WorkerConfig::max_instances for details
Sourcepub async fn launch(
self,
) -> Result<(Bot, EventStream<CoreResult<CoreEvent>>), BotInitError>
pub async fn launch( self, ) -> Result<(Bot, EventStream<CoreResult<CoreEvent>>), BotInitError>
Initialise the SimpleX FFI runtime and return a ready-to-use bot.
Auto Trait Implementations§
impl Freeze for BotBuilder
impl RefUnwindSafe for BotBuilder
impl Send for BotBuilder
impl Sync for BotBuilder
impl Unpin for BotBuilder
impl UnsafeUnpin for BotBuilder
impl UnwindSafe for BotBuilder
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> 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