pub struct BotBuilder { /* private fields */ }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 default 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_bio(self, bio: impl Into<String>) -> Self
pub fn with_bio(self, bio: impl Into<String>) -> Self
Set the bot bio (short_descr) during initialisation. Ignored when Self::with_profile is also set.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the bot description during initialisation. Ignored when Self::with_profile is also set.
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 with_worker_config(self, config: WorkerConfig) -> Self
pub fn with_worker_config(self, config: WorkerConfig) -> Self
Override FFI worker thread settings. See WorkerConfig for available options.
Sourcepub async fn launch(self) -> Result<(Bot, EventStream), BotInitError>
pub async fn launch(self) -> Result<(Bot, EventStream), BotInitError>
Initialise the SimpleX FFI runtime and return a ready-to-use bot.
Trait Implementations§
Source§impl Clone for BotBuilder
impl Clone for BotBuilder
Source§fn clone(&self) -> BotBuilder
fn clone(&self) -> BotBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto 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
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>
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>
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