Struct Client

Source
pub struct Client { /* private fields */ }
Expand description

Entrypoint for interacting with the API client.

Implementations§

Source§

impl Client

Source

pub fn new<T>(token: T) -> Self
where T: ToString,

Create a new Client struct.

§Panics

This function will panic if the internal http client fails to create

Source

pub fn with_host_override<H>(&mut self, host: H) -> &mut Self
where H: ToString,

Override the host for all endpoins in the client.

Source

pub fn remove_host_override(&mut self) -> &mut Self

Disables the global host override for the client.

Source

pub fn get_host_override(&self) -> Option<&str>

Source

pub fn new_from_env() -> Self

Create a new Client struct from environment variables.

The following environment variables are expected to be set:

  • SENDGRID_API_KEY
§Panics

This function will panic if the expected environment variables can not be found

Source

pub fn alerts(&self) -> Alerts

Source

pub fn api_key_permissions(&self) -> ApiKeyPermissions

Source

pub fn api_keys(&self) -> ApiKeys

Source

pub fn blocks_api(&self) -> BlocksApi

Source

pub fn bounces_api(&self) -> BouncesApi

Source

pub fn campaigns_api(&self) -> CampaignsApi

Source

pub fn cancel_scheduled_sends(&self) -> CancelScheduledSends

Source

pub fn categories(&self) -> Categories

Source

pub fn certificates(&self) -> Certificates

Source

pub fn contacts(&self) -> Contacts

Source

pub fn contacts_api_custom_fields(&self) -> ContactsApiCustomFields

Source

pub fn contacts_api_lists(&self) -> ContactsApiLists

Source

pub fn contacts_api_recipients(&self) -> ContactsApiRecipients

Source

pub fn contacts_api_segments(&self) -> ContactsApiSegments

Source

pub fn csv_ui_only(&self) -> CsvUiOnly

Source

pub fn custom_fields(&self) -> CustomFields

Source

pub fn designs_api(&self) -> DesignsApi

Source

pub fn domain_authentication(&self) -> DomainAuthentication

Source

pub fn email_address_validation(&self) -> EmailAddressValidation

Source

pub fn email_cname_records(&self) -> EmailCnameRecords

Source

pub fn invalid_emails_api(&self) -> InvalidEmailsApi

Source

pub fn ip_access_management(&self) -> IpAccessManagement

Source

pub fn ip_addresses(&self) -> IpAddresses

Source

pub fn ip_pools(&self) -> IpPools

Source

pub fn ip_warmup(&self) -> IpWarmup

Source

pub fn lists(&self) -> Lists

Source

pub fn mail_send(&self) -> MailSend

Source

pub fn marketing_campaigns_stats(&self) -> MarketingCampaignsStats

Source

pub fn query(&self) -> Query

Source

pub fn reverse_dns(&self) -> ReverseDns

Source

pub fn segmenting_contacts(&self) -> SegmentingContacts

Source

pub fn segmenting_contacts_beta(&self) -> SegmentingContactsBeta

Source

pub fn send_test_email(&self) -> SendTestEmail

Source

pub fn sender_identities_api(&self) -> SenderIdentitiesApi

Source

pub fn sender_verification(&self) -> SenderVerification

Source

pub fn senders(&self) -> Senders

Source

pub fn settings_enforced_tls(&self) -> SettingsEnforcedTls

Source

pub fn settings_inbound_parse(&self) -> SettingsInboundParse

Source

pub fn settings_mail(&self) -> SettingsMail

Source

pub fn settings_partner(&self) -> SettingsPartner

Source

pub fn settings_tracking(&self) -> SettingsTracking

Source

pub fn single_sends(&self) -> SingleSends

Source

pub fn single_sign_on_settings(&self) -> SingleSignOnSettings

Source

pub fn single_sign_on_teammates(&self) -> SingleSignOnTeammates

Source

pub fn spam_reports_api(&self) -> SpamReportsApi

Source

pub fn stats(&self) -> Stats

Source

pub fn subuser_monitor_settings(&self) -> SubuserMonitorSettings

Source

pub fn subuser_statistics(&self) -> SubuserStatistics

Source

pub fn subusers_api(&self) -> SubusersApi

Source

pub fn suppressions(&self) -> Suppressions

Source

pub fn suppressions_global(&self) -> SuppressionsGlobal

Source

pub fn suppressions_unsubscribe_groups(&self) -> SuppressionsUnsubscribeGroups

Source

pub fn teammates(&self) -> Teammates

Source

pub fn transactional_templates(&self) -> TransactionalTemplates

Source

pub fn transactional_templates_versions(&self) -> TransactionalTemplatesVersions

Source

pub fn users_api(&self) -> UsersApi

Source

pub fn webhooks(&self) -> Webhooks

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T