[][src]Struct sendgrid_rs::attachment::AttachmentBuilder

pub struct AttachmentBuilder { /* fields omitted */ }

Builder pattern for creating an Attachment Make sure you call build() when done to consume the builder and return the underlying Attachment

Methods

impl AttachmentBuilder
[src]

pub fn new<S: Into<String>>(content: S, filename: S) -> Self
[src]

Constructs an AttachmentBuilder. The required parameters are the content (base64 string) and the filename.

Examples


let builder = AttachmentBuilder::new(
                "SGVsbG8gV29ybGQh",
                "file.txt");

pub fn attachment_type(
    self,
    t: impl Into<String>
) -> Self
[src]

Sets the mime type on the Attachment

Examples


let builder = AttachmentBuilder::new(
                "SGVsbG8gV29ybGQh",
                "file.txt")
              .attachment_type("text/plain");

pub fn disposition(
    self,
    disposition: impl Into<String>
) -> Self
[src]

Sets the disposition of the Attachment

Examples


let builder = AttachmentBuilder::new(
                "SGVsbG8gV29ybGQh",
                "file.txt")
              .disposition("inline");

pub fn content_id(
    self,
    id: impl Into<String>
) -> Self
[src]

Sets the content_id of the Attachment

Examples


let builder = AttachmentBuilder::new(
                "SGVsbG8gV29ybGQh",
                "file.txt")
              .content_id("id");

pub fn build(self) -> Attachment
[src]

Consumes the AttachmentBuilder and returns the underlying Attachment

Examples


let builder = AttachmentBuilder::new(
                "SGVsbG8gV29ybGQh",
                "file.txt")
              .build();

Auto Trait Implementations

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]