pub struct AttachmentBuilder { /* private fields */ }
Expand description
Builder pattern for creating an Attachment
Make sure you call build()
when done to consume the builder and return the underlying Attachment
Implementations§
Source§impl AttachmentBuilder
impl AttachmentBuilder
Sourcepub fn new<S: Into<String>>(content: S, filename: S) -> Self
pub fn new<S: Into<String>>(content: S, filename: S) -> Self
Constructs an AttachmentBuilder
. The required parameters are the content (base64 string)
and the filename.
§Examples
let builder = AttachmentBuilder::new(
"SGVsbG8gV29ybGQh",
"file.txt");
Sourcepub fn attachment_type(self, t: impl Into<String>) -> Self
pub fn attachment_type(self, t: impl Into<String>) -> Self
Sets the mime type on the Attachment
§Examples
let builder = AttachmentBuilder::new(
"SGVsbG8gV29ybGQh",
"file.txt")
.attachment_type("text/plain");
Sourcepub fn disposition(self, disposition: impl Into<String>) -> Self
pub fn disposition(self, disposition: impl Into<String>) -> Self
Sets the disposition of the Attachment
§Examples
let builder = AttachmentBuilder::new(
"SGVsbG8gV29ybGQh",
"file.txt")
.disposition("inline");
Sourcepub fn content_id(self, id: impl Into<String>) -> Self
pub fn content_id(self, id: impl Into<String>) -> Self
Sets the content_id of the Attachment
§Examples
let builder = AttachmentBuilder::new(
"SGVsbG8gV29ybGQh",
"file.txt")
.content_id("id");
Sourcepub fn build(self) -> Attachment
pub fn build(self) -> Attachment
Consumes the AttachmentBuilder
and returns the underlying Attachment
§Examples
let builder = AttachmentBuilder::new(
"SGVsbG8gV29ybGQh",
"file.txt")
.build();
Auto Trait Implementations§
impl Freeze for AttachmentBuilder
impl RefUnwindSafe for AttachmentBuilder
impl Send for AttachmentBuilder
impl Sync for AttachmentBuilder
impl Unpin 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