Struct twilight_util::builder::command::SubCommandBuilder
source · [−]pub struct SubCommandBuilder(_);Available on crate feature
builder only.Expand description
Create a subcommand option with a builder.
Implementations
sourceimpl SubCommandBuilder
impl SubCommandBuilder
sourcepub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
Create a new default SubCommandBuilder.
sourcepub fn build(self) -> CommandOption
pub fn build(self) -> CommandOption
Consume the builder, returning the built command option.
sourcepub fn description_localizations<K: Into<String>, V: Into<String>>(
self,
localizations: impl IntoIterator<Item = (K, V)>
) -> Self
pub fn description_localizations<K: Into<String>, V: Into<String>>(
self,
localizations: impl IntoIterator<Item = (K, V)>
) -> Self
Set the localization dictionary for the option description.
Defaults to None.
sourcepub fn name_localizations<K: Into<String>, V: Into<String>>(
self,
localizations: impl IntoIterator<Item = (K, V)>
) -> Self
pub fn name_localizations<K: Into<String>, V: Into<String>>(
self,
localizations: impl IntoIterator<Item = (K, V)>
) -> Self
Set the localization dictionary for the option name.
Defaults to None.
sourcepub fn option(self, option: impl Into<CommandOption>) -> Self
pub fn option(self, option: impl Into<CommandOption>) -> Self
Add an option to the sub command.
Defaults to an empty list.
Trait Implementations
sourceimpl Clone for SubCommandBuilder
impl Clone for SubCommandBuilder
sourcefn clone(&self) -> SubCommandBuilder
fn clone(&self) -> SubCommandBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for SubCommandBuilder
impl Debug for SubCommandBuilder
sourceimpl From<SubCommandBuilder> for CommandOption
impl From<SubCommandBuilder> for CommandOption
sourcefn from(builder: SubCommandBuilder) -> CommandOption
fn from(builder: SubCommandBuilder) -> CommandOption
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for SubCommandBuilder
impl Send for SubCommandBuilder
impl Sync for SubCommandBuilder
impl Unpin for SubCommandBuilder
impl UnwindSafe for SubCommandBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more