pub struct Attachment {
pub filename: String,
pub content_type: String,
pub bytes: Vec<u8>,
}Expand description
A file travelling with the message.
Fields§
§filename: String§content_type: String§bytes: Vec<u8>Implementations§
Source§impl Attachment
impl Attachment
Sourcepub fn new(filename: impl Into<String>, bytes: impl Into<Vec<u8>>) -> Attachment
pub fn new(filename: impl Into<String>, bytes: impl Into<Vec<u8>>) -> Attachment
An attachment whose type is guessed from the file extension.
pub fn with_content_type(self, content_type: impl Into<String>) -> Attachment
Trait Implementations§
Source§impl Clone for Attachment
impl Clone for Attachment
Source§fn clone(&self) -> Attachment
fn clone(&self) -> Attachment
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Attachment
impl Debug for Attachment
impl Eq for Attachment
Source§impl PartialEq for Attachment
impl PartialEq for Attachment
impl StructuralPartialEq for Attachment
Auto Trait Implementations§
impl Freeze for Attachment
impl RefUnwindSafe for Attachment
impl Send for Attachment
impl Sync for Attachment
impl Unpin for Attachment
impl UnsafeUnpin for Attachment
impl UnwindSafe for Attachment
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