Struct sendgrid::v3::Attachment
source · pub struct Attachment { /* private fields */ }
Expand description
An attachment block for a V3 message. Content and filename are required. If the mime_type is unspecified, the email will use Sendgrid’s default for attachments which is ‘application/octet-stream’.
Implementations§
source§impl Attachment
impl Attachment
sourcepub fn new() -> Attachment
pub fn new() -> Attachment
Construct a new attachment for this message.
sourcepub fn set_content(self, c: &[u8]) -> Attachment
pub fn set_content(self, c: &[u8]) -> Attachment
The raw body of the attachment.
sourcepub fn set_base64_content<S: Into<String>>(self, c: S) -> Attachment
pub fn set_base64_content<S: Into<String>>(self, c: S) -> Attachment
The base64 body of the attachment.
sourcepub fn set_filename<S: Into<String>>(self, filename: S) -> Attachment
pub fn set_filename<S: Into<String>>(self, filename: S) -> Attachment
Sets the filename for the attachment.
sourcepub fn set_mime_type<S: Into<String>>(self, mime: S) -> Attachment
pub fn set_mime_type<S: Into<String>>(self, mime: S) -> Attachment
Set an optional mime type. Sendgrid will default to ‘application/octet-stream’ if unspecified.
sourcepub fn set_content_idm<S: Into<String>>(self, content_id: S) -> Attachment
pub fn set_content_idm<S: Into<String>>(self, content_id: S) -> Attachment
Set an optional content id.
sourcepub fn set_disposition(self, disposition: Disposition) -> Attachment
pub fn set_disposition(self, disposition: Disposition) -> Attachment
Set an optional disposition.
Trait Implementations§
source§impl Default for Attachment
impl Default for Attachment
source§fn default() -> Attachment
fn default() -> Attachment
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Attachment
impl RefUnwindSafe for Attachment
impl Send for Attachment
impl Sync for Attachment
impl Unpin 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