pub struct Resend {
pub emails: EmailsSvc,
pub batch: BatchSvc,
pub api_keys: ApiKeysSvc,
pub audiences: AudiencesSvc,
pub contacts: ContactsSvc,
pub domains: DomainsSvc,
pub broadcasts: BroadcastsSvc,
}
Expand description
The Resend client.
Fields§
§emails: EmailsSvc
Resend
APIs for /emails
endpoints.
batch: BatchSvc
Resend
APIs for the batch /emails
endpoints.
api_keys: ApiKeysSvc
Resend
APIs for /api-keys
endpoints.
audiences: AudiencesSvc
Resend
APIs for /audiences
endpoints.
contacts: ContactsSvc
Resend
APIs for /audiences/:id/contacts
endpoints.
domains: DomainsSvc
Resend
APIs for /domains
endpoints.
broadcasts: BroadcastsSvc
Resend
APIs for /broadcasts
endpoints.
Implementations§
Source§impl Resend
impl Resend
Sourcepub fn with_client(api_key: &str, client: ReqwestClient) -> Self
pub fn with_client(api_key: &str, client: ReqwestClient) -> Self
Creates a new Resend
client with a provided reqwest::Client
.
§Panics
- Panics if the environment variable
RESEND_BASE_URL
is set but is not a validURL
.
Sourcepub fn with_config(config: Config) -> Self
pub fn with_config(config: Config) -> Self
Creates a new Resend
client with a provided Config
.
Use ConfigBuilder::new
to construct a Config
instance.
§Panics
- Panics if the base url has not been set with
ConfigBuilder::base_url
and the environment variableRESEND_BASE_URL
is set but is not a validURL
.
Sourcepub fn user_agent(&self) -> &str
pub fn user_agent(&self) -> &str
Returns the reference to the used User-Agent
header value.
Sourcepub fn base_url(&self) -> &str
pub fn base_url(&self) -> &str
Returns the reference to the used base URL
.
§Notes
Use the RESEND_BASE_URL
environment variable to override.
Sourcepub fn client(&self) -> ReqwestClient
pub fn client(&self) -> ReqwestClient
Returns the underlying reqwest::Client
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Resend
impl !RefUnwindSafe for Resend
impl Send for Resend
impl Sync for Resend
impl Unpin for Resend
impl !UnwindSafe for Resend
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