pub struct CommandBuilder { /* private fields */ }
Expand description
Command builder with safe argument construction
Implementations§
Source§impl CommandBuilder
impl CommandBuilder
Sourcepub fn option(self, key: impl AsRef<str>, value: impl ToString) -> Self
pub fn option(self, key: impl AsRef<str>, value: impl ToString) -> Self
Add an option with a value
Sourcepub fn option_if_some<T: ToString>(
self,
key: impl AsRef<str>,
value: Option<T>,
) -> Self
pub fn option_if_some<T: ToString>( self, key: impl AsRef<str>, value: Option<T>, ) -> Self
Add an option only if the value is Some
Sourcepub fn flag_if(self, flag: impl AsRef<str>, condition: bool) -> Self
pub fn flag_if(self, flag: impl AsRef<str>, condition: bool) -> Self
Add a flag only if the condition is true
Sourcepub fn args(self, args: impl IntoIterator<Item = impl AsRef<str>>) -> Self
pub fn args(self, args: impl IntoIterator<Item = impl AsRef<str>>) -> Self
Add raw arguments
Trait Implementations§
Source§impl Clone for CommandBuilder
impl Clone for CommandBuilder
Source§fn clone(&self) -> CommandBuilder
fn clone(&self) -> CommandBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CommandBuilder
impl Debug for CommandBuilder
Auto Trait Implementations§
impl Freeze for CommandBuilder
impl RefUnwindSafe for CommandBuilder
impl Send for CommandBuilder
impl Sync for CommandBuilder
impl Unpin for CommandBuilder
impl UnwindSafe for CommandBuilder
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