pub struct SimplexCliBuilder<I = Empty<OsString>> { /* private fields */ }Available on crate feature
cli only.Expand description
Builder for SimplexCli.
Obtained via SimplexCli::builder.
§Example
ⓘ
let cli = SimplexCli::builder("Bot", 5225)
.db_prefix("/var/db/simplex")
.db_key(secret)
.arg("--smp-servers=smp://example.com")
.spawn()
.await?;Implementations§
Source§impl<I> SimplexCliBuilder<I>
impl<I> SimplexCliBuilder<I>
Sourcepub fn db_prefix(self, path: impl Into<String>) -> Self
pub fn db_prefix(self, path: impl Into<String>) -> Self
Sets the path to the SimpleX database directory (defaults to ".").
Sourcepub fn db_key(self, key: impl Into<String>) -> Self
pub fn db_key(self, key: impl Into<String>) -> Self
Passes a database encryption key via the -k flag.
Sourcepub fn arg(
self,
arg: impl Into<OsString>,
) -> SimplexCliBuilder<Chain<I, Once<OsString>>>
pub fn arg( self, arg: impl Into<OsString>, ) -> SimplexCliBuilder<Chain<I, Once<OsString>>>
Adds an extra command argument
Sourcepub fn args<J>(self, args: J) -> SimplexCliBuilder<Chain<I, J::IntoIter>>where
J: IntoIterator<Item = OsString>,
pub fn args<J>(self, args: J) -> SimplexCliBuilder<Chain<I, J::IntoIter>>where
J: IntoIterator<Item = OsString>,
Adds multiple extra command arguments
Sourcepub async fn spawn(self) -> Result<SimplexCli>
pub async fn spawn(self) -> Result<SimplexCli>
Spawns the simplex-chat process and returns a SimplexCli handle.
Checks the installed CLI version against the supported range before spawning.
Auto Trait Implementations§
impl<I> Freeze for SimplexCliBuilder<I>where
I: Freeze,
impl<I> RefUnwindSafe for SimplexCliBuilder<I>where
I: RefUnwindSafe,
impl<I> Send for SimplexCliBuilder<I>where
I: Send,
impl<I> Sync for SimplexCliBuilder<I>where
I: Sync,
impl<I> Unpin for SimplexCliBuilder<I>where
I: Unpin,
impl<I> UnsafeUnpin for SimplexCliBuilder<I>where
I: UnsafeUnpin,
impl<I> UnwindSafe for SimplexCliBuilder<I>where
I: UnwindSafe,
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