[][src]Struct sendgrid::SGClient

pub struct SGClient { /* fields omitted */ }

This is the struct that allows you to authenticate to the SendGrid API. It's only field is the API key which allows you to send messages.

Methods

impl SGClient[src]

pub fn new(key: String) -> SGClient[src]

Makes a new SendGrid cient with the specified API key.

pub fn send(&self, mail_info: Mail) -> SendgridResult<String>[src]

Sends a messages through the SendGrid API. It takes a Mail struct as an argument. It returns the string response from the API as JSON. It sets the Content-Type to be application/x-www-form-urlencoded.

Trait Implementations

impl Clone for SGClient[src]

impl Debug for SGClient[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.