pub trait DnsProvider: Send + Sync {
// Required methods
fn create_record<'life0, 'life1, 'async_trait>(
&'life0 self,
subdomain: &'life1 str,
proxied: bool,
) -> Pin<Box<dyn Future<Output = Result<String, DnsError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_record<'life0, 'life1, 'async_trait>(
&'life0 self,
record_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), DnsError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_origin_certificate<'life0, 'async_trait>(
&'life0 self,
validity_days: u32,
) -> Pin<Box<dyn Future<Output = Result<Option<OriginCertificate>, DnsError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn cleanup_old_origin_certificates<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u32, DnsError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for DNS and certificate management providers
This abstraction allows the server to work with different DNS backends, such as Cloudflare for production or a mock implementation for testing.
Required Methods§
Sourcefn create_record<'life0, 'life1, 'async_trait>(
&'life0 self,
subdomain: &'life1 str,
proxied: bool,
) -> Pin<Box<dyn Future<Output = Result<String, DnsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_record<'life0, 'life1, 'async_trait>(
&'life0 self,
subdomain: &'life1 str,
proxied: bool,
) -> Pin<Box<dyn Future<Output = Result<String, DnsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn delete_record<'life0, 'life1, 'async_trait>(
&'life0 self,
record_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), DnsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_record<'life0, 'life1, 'async_trait>(
&'life0 self,
record_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), DnsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a DNS record by its ID