[][src]Struct dns_online::Domain

pub struct Domain<'a> {
    pub api_key: &'a str,
    pub id: usize,
    pub name: String,
    pub dnssec: bool,
    pub external: bool,
}

A DNS domain. For API design reasons, we also store the API key inside the domain.

Fields

api_key: &'a strid: usizename: Stringdnssec: boolexternal: bool

Methods

impl<'a> Domain<'a>[src]

pub fn find_and_extract_path(
    full_domain_name: &'a str,
    domains: Vec<Domain<'a>>
) -> Option<(Self, &'a str)>
[src]

Try to extract the longest matching domain from the list of our available domains and the internal part of the name. e.g. extract_domain("this.is.a.dummy.test.fr.", {Domain("test.fr"), Domain("nope.fr")}) should return the domain associated with "test.fr". and the internal path, aka "this.is.a.dummy."

pub fn filter_records(
    &self,
    zone: &Version,
    entry_name: &str,
    entry_value: Option<&str>
) -> Result<Option<Vec<Record>>, Error>
[src]

Extract all records with a name of "entry_name" and with a value of "entry_value" (or any value if entry_value is None) from the zone 'zone'.

pub fn add_record(
    &self,
    destination: &Version,
    record: &Record
) -> Result<Record, Error>
[src]

Append a new entry 'record' to the zone 'destination'. The target zone MUST be inactive.

pub fn copy_records(
    &self,
    source: Vec<Record>,
    destination: &Version
) -> Result<Vec<Record>, Error>
[src]

Copy all the records from 'source' to the zone 'destination' and return the updated zone records. This will not erase the current entries but append next to the them.

pub fn set_zone_entries(
    &self,
    destination: &Version,
    records: &[Record]
) -> Result<(), Error>
[src]

Populate the zone "destination" with 'records'. Note this will destroy any prior entry in that zone. Internally this calls the endpoint /domain/{domain_name}/version/{version_id}/zone_from_bind

pub fn add_version(&self, name: &str) -> Result<Version, Error>[src]

Create a new (disabled at the moment) zone.

pub fn enable_version(&self, v: &Version) -> Result<(), Error>[src]

Enable a specific zone as the current one for the domain.

pub fn delete_version(&self, v: &Version) -> Result<(), Error>[src]

Delete an old zone. As a result, deleting the current zone will fail.

pub fn get_version(&self, uuid: &str) -> Result<Version, Error>[src]

Return the version of a given uuid

pub fn get_versions(&self) -> Result<Vec<Version>, Error>[src]

Return the list of all available zones.

pub fn get_current_zone(&self) -> Result<Version, Error>[src]

Retrieve the Version describing the currently enable zone

pub fn get_zone_records(&self, zone: &Version) -> Result<Vec<Record>, Error>[src]

Return the list of all the records in the zone 'zone'.

pub fn delete_record(
    &self,
    zone: &Version,
    record: &Record
) -> Result<(), Error>
[src]

Delete a record in 'zone' matching 'record'

Trait Implementations

impl<'a> Clone for Domain<'a>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a> Debug for Domain<'a>[src]

impl<'de, 'a> Deserialize<'de> for Domain<'a>[src]

Auto Trait Implementations

impl<'a> Send for Domain<'a>

impl<'a> Unpin for Domain<'a>

impl<'a> Sync for Domain<'a>

impl<'a> UnwindSafe for Domain<'a>

impl<'a> RefUnwindSafe for Domain<'a>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]