#[non_exhaustive]
pub enum AttachmentType<'a> {
Bytes {
data: Cow<'a, [u8]>,
filename: String,
},
File {
file: &'a File,
filename: String,
},
Path(&'a Path),
Image(Url),
}
Expand description
Enum that allows a user to pass a Path
or a File
type to send_files
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Bytes
Indicates that the AttachmentType
is a byte slice with a filename.
File
Indicates that the AttachmentType
is a File
Path(&'a Path)
Indicates that the AttachmentType
is a Path
Image(Url)
Indicates that the AttachmentType
is an image URL.
Trait Implementations
sourceimpl<'a> Clone for AttachmentType<'a>
impl<'a> Clone for AttachmentType<'a>
sourcefn clone(&self) -> AttachmentType<'a>
fn clone(&self) -> AttachmentType<'a>
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 more
sourceimpl<'a> Debug for AttachmentType<'a>
impl<'a> Debug for AttachmentType<'a>
sourceimpl<'a> From<&'a Path> for AttachmentType<'a>
impl<'a> From<&'a Path> for AttachmentType<'a>
sourcefn from(path: &'a Path) -> AttachmentType<'_>
fn from(path: &'a Path) -> AttachmentType<'_>
Converts to this type from the input type.
sourceimpl<'a> From<&'a PathBuf> for AttachmentType<'a>
impl<'a> From<&'a PathBuf> for AttachmentType<'a>
sourcefn from(pathbuf: &'a PathBuf) -> AttachmentType<'_>
fn from(pathbuf: &'a PathBuf) -> AttachmentType<'_>
Converts to this type from the input type.
sourceimpl<'a> From<&'a str> for AttachmentType<'a>
impl<'a> From<&'a str> for AttachmentType<'a>
sourcefn from(s: &'a str) -> AttachmentType<'_>
fn from(s: &'a str) -> AttachmentType<'_>
Constructs an AttachmentType
from a string.
This string may refer to the path of a file on disk, or the http url to an image on the internet.
sourceimpl<'a> From<(&'a [u8], &str)> for AttachmentType<'a>
impl<'a> From<(&'a [u8], &str)> for AttachmentType<'a>
sourcefn from(params: (&'a [u8], &str)) -> AttachmentType<'a>
fn from(params: (&'a [u8], &str)) -> AttachmentType<'a>
Converts to this type from the input type.
sourceimpl<'a> From<(&'a File, &str)> for AttachmentType<'a>
impl<'a> From<(&'a File, &str)> for AttachmentType<'a>
sourcefn from(f: (&'a File, &str)) -> AttachmentType<'a>
fn from(f: (&'a File, &str)) -> AttachmentType<'a>
Converts to this type from the input type.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for AttachmentType<'a>
impl<'a> Send for AttachmentType<'a>
impl<'a> Sync for AttachmentType<'a>
impl<'a> Unpin for AttachmentType<'a>
impl<'a> !UnwindSafe for AttachmentType<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more