Cloudflare

Struct Cloudflare 

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

This represents object to talk to cloudflare api

Implementations§

Source§

impl Cloudflare

Source

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

Source

pub fn list(self, zone: Zone) -> CFResponse

List zones

List Zones

Source

pub fn list_dns_record( &self, dns_type: DnsRecordType, domain_name: &str, zone: &str, ) -> CFResponse

List dns record

List Zones

Source

pub fn create_dns_record<T: Validate + Serialize>( &self, record: T, zone: &str, ) -> Result<CFCreateResponse, ValidationErrors>

Create a dns record

POST zones/:zone_identifier/dns_records

Create DNS Record

Source

pub fn delete_dns_record( &self, zone: &str, dns_record: &str, ) -> CFDeleteResponse

Delete a dns record

DELETE zones/:zone_identifier/dns_records/:identifier

Delete DNS Record

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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<T> ErasedDestructor for T
where T: 'static,