DnsProvider

Trait DnsProvider 

Source
pub trait DnsProvider {
    // Required methods
    fn get_record<T>(
        &self,
        rtype: RecordType,
        host: &str,
    ) -> impl Future<Output = Result<Option<T>>>
       where T: DeserializeOwned;
    fn create_record<T>(
        &self,
        rtype: RecordType,
        host: &str,
        record: &T,
    ) -> impl Future<Output = Result<()>>
       where T: Serialize + DeserializeOwned + Display + Clone + Send + Sync;
    fn update_record<T>(
        &self,
        rtype: RecordType,
        host: &str,
        record: &T,
    ) -> impl Future<Output = Result<()>>
       where T: Serialize + DeserializeOwned + Display + Clone + Send + Sync;
    fn delete_record(
        &self,
        rtype: RecordType,
        host: &str,
    ) -> impl Future<Output = Result<()>>;

    // Provided methods
    async fn get_txt_record(&self, host: &str) -> Result<Option<String>> { ... }
    async fn create_txt_record(&self, host: &str, record: &String) -> Result<()> { ... }
    async fn update_txt_record(&self, host: &str, record: &String) -> Result<()> { ... }
    async fn delete_txt_record(&self, host: &str) -> Result<()> { ... }
    async fn get_a_record(&self, host: &str) -> Result<Option<Ipv4Addr>> { ... }
    async fn create_a_record(&self, host: &str, record: &Ipv4Addr) -> Result<()> { ... }
    async fn update_a_record(&self, host: &str, record: &Ipv4Addr) -> Result<()> { ... }
    async fn delete_a_record(&self, host: &str) -> Result<()> { ... }
}

Required Methods§

Source

fn get_record<T>( &self, rtype: RecordType, host: &str, ) -> impl Future<Output = Result<Option<T>>>

Source

fn create_record<T>( &self, rtype: RecordType, host: &str, record: &T, ) -> impl Future<Output = Result<()>>

Source

fn update_record<T>( &self, rtype: RecordType, host: &str, record: &T, ) -> impl Future<Output = Result<()>>

Source

fn delete_record( &self, rtype: RecordType, host: &str, ) -> impl Future<Output = Result<()>>

Provided Methods§

Source

async fn get_txt_record(&self, host: &str) -> Result<Option<String>>

Source

async fn create_txt_record(&self, host: &str, record: &String) -> Result<()>

Source

async fn update_txt_record(&self, host: &str, record: &String) -> Result<()>

Source

async fn delete_txt_record(&self, host: &str) -> Result<()>

Source

async fn get_a_record(&self, host: &str) -> Result<Option<Ipv4Addr>>

Source

async fn create_a_record(&self, host: &str, record: &Ipv4Addr) -> Result<()>

Source

async fn update_a_record(&self, host: &str, record: &Ipv4Addr) -> Result<()>

Source

async fn delete_a_record(&self, host: &str) -> Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§