pub struct AttachmentBuilder(/* private fields */);Available on crate feature
builder only.Expand description
Create an attachment option with a builder.
Implementations§
Source§impl AttachmentBuilder
impl AttachmentBuilder
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 AttachmentBuilder.
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 file_types(
self,
file_types: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn file_types( self, file_types: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Set the file types to filter for.
Can be image, video, audio, or any dot-prefixed extension such as .pdf.
Defaults to None.
Trait Implementations§
Source§impl Clone for AttachmentBuilder
impl Clone for AttachmentBuilder
Source§impl Debug for AttachmentBuilder
impl Debug for AttachmentBuilder
Source§impl From<AttachmentBuilder> for CommandOption
impl From<AttachmentBuilder> for CommandOption
Source§fn from(builder: AttachmentBuilder) -> CommandOption
fn from(builder: AttachmentBuilder) -> CommandOption
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AttachmentBuilder
impl RefUnwindSafe for AttachmentBuilder
impl Send for AttachmentBuilder
impl Sync for AttachmentBuilder
impl Unpin for AttachmentBuilder
impl UnsafeUnpin for AttachmentBuilder
impl UnwindSafe for AttachmentBuilder
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