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§
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<()>>
fn update_record<T>( &self, rtype: RecordType, host: &str, record: &T, ) -> impl Future<Output = Result<()>>
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<()>
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.