Struct twilight_util::builder::command::ChannelBuilder
source · [−]pub struct ChannelBuilder(_);Available on crate feature
builder only.Expand description
Create a channel option with a builder.
Implementations
sourceimpl ChannelBuilder
impl ChannelBuilder
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 ChannelBuilder.
sourcepub fn build(self) -> CommandOption
pub fn build(self) -> CommandOption
Consume the builder, returning the built command option.
sourcepub fn channel_types(
self,
channel_types: impl IntoIterator<Item = ChannelType>
) -> Self
pub fn channel_types(
self,
channel_types: impl IntoIterator<Item = ChannelType>
) -> Self
Restricts the channel choice to specific types.
Defaults to all channel types allowed.
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.
Trait Implementations
sourceimpl Clone for ChannelBuilder
impl Clone for ChannelBuilder
sourcefn clone(&self) -> ChannelBuilder
fn clone(&self) -> ChannelBuilder
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 ChannelBuilder
impl Debug for ChannelBuilder
sourceimpl From<ChannelBuilder> for CommandOption
impl From<ChannelBuilder> for CommandOption
sourcefn from(builder: ChannelBuilder) -> CommandOption
fn from(builder: ChannelBuilder) -> CommandOption
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for ChannelBuilder
impl Send for ChannelBuilder
impl Sync for ChannelBuilder
impl Unpin for ChannelBuilder
impl UnwindSafe for ChannelBuilder
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