pub struct Cloudflare { /* private fields */ }Expand description
This represents object to talk to cloudflare api
Implementations§
Source§impl Cloudflare
impl Cloudflare
Sourcepub fn default(api_key: Option<String>) -> Cloudflare
pub fn default(api_key: Option<String>) -> Cloudflare
Initializes the struct with an api token.
If the api token is not passed as a parameter then uses the
environment variable CLOUDFLARE_API_KEY to get the api token
Sourcepub fn list(self, zone: Zone) -> CFResponse
pub fn list(self, zone: Zone) -> CFResponse
List zones
Sourcepub fn list_dns_record(
&self,
dns_type: DnsRecordType,
domain_name: &str,
zone: &str,
) -> CFResponse
pub fn list_dns_record( &self, dns_type: DnsRecordType, domain_name: &str, zone: &str, ) -> CFResponse
List dns record
Sourcepub fn create_dns_record<T: Validate + Serialize>(
&self,
record: T,
zone: &str,
) -> Result<CFCreateResponse, ValidationErrors>
pub fn create_dns_record<T: Validate + Serialize>( &self, record: T, zone: &str, ) -> Result<CFCreateResponse, ValidationErrors>
Sourcepub fn delete_dns_record(
&self,
zone: &str,
dns_record: &str,
) -> CFDeleteResponse
pub fn delete_dns_record( &self, zone: &str, dns_record: &str, ) -> CFDeleteResponse
Auto Trait Implementations§
impl Freeze for Cloudflare
impl RefUnwindSafe for Cloudflare
impl Send for Cloudflare
impl Sync for Cloudflare
impl Unpin for Cloudflare
impl UnwindSafe for Cloudflare
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