pub struct ZeroBounce {
pub api_key: String,
pub base_url: String,
pub client: Client,
pub url_provider: ZBUrlProvider,
}Fields§
§api_key: String§base_url: String§client: Client§url_provider: ZBUrlProviderImplementations§
Source§impl ZeroBounce
impl ZeroBounce
pub fn bulk_validation_file_submit( &self, zb_file: &ZBFile, ) -> ZBResult<ZBFileFeedback>
pub fn bulk_validation_file_status_check( &self, file_id: &str, ) -> ZBResult<ZBFileStatus>
pub fn bulk_validation_result_fetch( &self, file_id: &str, ) -> ZBResult<ZBBulkResponse>
pub fn bulk_validation_result_delete( &self, file_id: &str, ) -> ZBResult<ZBFileFeedback>
pub fn ai_scoring_file_submit( &self, zb_file: &ZBFile, ) -> ZBResult<ZBFileFeedback>
pub fn ai_scoring_file_status_check( &self, file_id: &str, ) -> ZBResult<ZBFileStatus>
pub fn ai_scoring_result_fetch(&self, file_id: &str) -> ZBResult<ZBBulkResponse>
pub fn ai_scoring_result_delete( &self, file_id: &str, ) -> ZBResult<ZBFileFeedback>
Source§impl ZeroBounce
impl ZeroBounce
pub fn validate_email_and_ip( &self, email: &str, ip_address: &str, ) -> ZBResult<ZBValidation>
pub fn validate_email(&self, email: &str) -> ZBResult<ZBValidation>
pub fn batch_validate( &self, emails_and_ip_addresses: Vec<(String, String)>, ) -> ZBResult<ZBBatchValidation>
Source§impl ZeroBounce
impl ZeroBounce
pub fn get_credits(&self) -> ZBResult<i64>
pub fn get_api_usage( &self, start_date: NaiveDate, end_date: NaiveDate, ) -> ZBResult<ApiUsage>
pub fn get_api_usage_overall(&self) -> ZBResult<ApiUsage>
pub fn get_activity_data(&self, email: &str) -> ZBResult<ActivityData>
Sourcepub fn find_email(
&self,
domain: &str,
first_name: &str,
middle_name: &str,
last_name: &str,
) -> ZBResult<FindEmailResponse>
👎Deprecated since 1.2.0: Use find_email_v2 instead. The new version supports both domain and company_name parameters.
pub fn find_email( &self, domain: &str, first_name: &str, middle_name: &str, last_name: &str, ) -> ZBResult<FindEmailResponse>
find_email_v2 instead. The new version supports both domain and company_name parameters.Deprecated: Use find_email_v2 instead.
This function is kept for backward compatibility but will be removed in a future version.
Sourcepub fn find_email_v2(&self) -> FindEmailV2Builder<'_>
pub fn find_email_v2(&self) -> FindEmailV2Builder<'_>
Find an email address using either a domain or company name.
Returns a builder that allows you to set parameters using method chaining.
§Requirements
first_nameis mandatory- Exactly one of
domainorcompany_namemust be provided (XOR requirement)
§Example
use zero_bounce::ZeroBounce;
use zero_bounce::utility::ZBResult;
let zb = ZeroBounce::new("your_api_key");
// Using domain
let result = zb.find_email_v2()
.first_name("John")
.domain("example.com")
.last_name("Doe")
.call()?;
// Or using company name
let result = zb.find_email_v2()
.first_name("John")
.company_name("Example Inc")
.last_name("Doe")
.call()?;Sourcepub fn domain_search(&self, domain: &str) -> ZBResult<FindEmailResponse>
👎Deprecated since 1.2.0: Use domain_search_v2 instead. The new version supports both domain and company_name parameters.
pub fn domain_search(&self, domain: &str) -> ZBResult<FindEmailResponse>
domain_search_v2 instead. The new version supports both domain and company_name parameters.Deprecated: Use domain_search_v2 instead.
This function is kept for backward compatibility but will be removed in a future version.
Sourcepub fn domain_search_v2(&self) -> DomainSearchV2Builder<'_>
pub fn domain_search_v2(&self) -> DomainSearchV2Builder<'_>
Search for email formats using either a domain or company name.
Returns a builder that allows you to set parameters using method chaining.
§Requirements
Exactly one of domain or company_name must be provided (XOR requirement).
§Example
use zero_bounce::ZeroBounce;
use zero_bounce::utility::ZBResult;
let zb = ZeroBounce::new("your_api_key");
// Using domain
let result = zb.domain_search_v2()
.domain("example.com")
.call()?;
// Or using company name
let result = zb.domain_search_v2()
.company_name("Example Inc")
.call()?;Source§impl ZeroBounce
impl ZeroBounce
Sourcepub fn new(api_key: &str) -> ZeroBounce
pub fn new(api_key: &str) -> ZeroBounce
Sourcepub fn with_base_url<T>(api_key: &str, base_url: T) -> ZeroBounce
pub fn with_base_url<T>(api_key: &str, base_url: T) -> ZeroBounce
Create a new ZeroBounce client instance with a custom base URL.
§Arguments
api_key- Your ZeroBounce API keybase_url- Base URL. Can be:ApiBaseUrl::Default- Uses the default API URLApiBaseUrl::USA- Uses the USA API URLApiBaseUrl::EU- Uses the EU API URLStringor&str- Uses a custom URL string
§Example
use zero_bounce::{ZeroBounce, ApiBaseUrl};
// Using enum
let zb = ZeroBounce::with_base_url("your_api_key", ApiBaseUrl::USA);
// Using custom string
let zb = ZeroBounce::with_base_url("your_api_key", "https://custom-api.example.com/v2/");Auto Trait Implementations§
impl Freeze for ZeroBounce
impl !RefUnwindSafe for ZeroBounce
impl Send for ZeroBounce
impl Sync for ZeroBounce
impl Unpin for ZeroBounce
impl UnsafeUnpin for ZeroBounce
impl !UnwindSafe for ZeroBounce
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