Trait Provider

Source
pub trait Provider {
    type Zone: Zone;
    type CustomRetrieveError: Debug;

    // Required methods
    fn list_zones(
        &self,
    ) -> impl Future<Output = Result<Vec<Self::Zone>, RetrieveZoneError<Self::CustomRetrieveError>>>;
    fn get_zone(
        &self,
        zone_id: &str,
    ) -> impl Future<Output = Result<Self::Zone, RetrieveZoneError<Self::CustomRetrieveError>>>;
}
Expand description

Represents a DNS zone provider.

Providers implement Zone management, which in turn implement Record management. By default, only zone retrieval is supported, but the following additional capabilities may be implemented to allow further zone management:

Required Associated Types§

Source

type Zone: Zone

The provider-specific zone type.

Source

type CustomRetrieveError: Debug

The provider-specific custom zone retrieval error type used for RetrieveZoneError::Custom.
If no custom errors should be provided, use ().

Required Methods§

Source

fn list_zones( &self, ) -> impl Future<Output = Result<Vec<Self::Zone>, RetrieveZoneError<Self::CustomRetrieveError>>>

Retrieves all available zones.
When no record exists, an Ok value with an empty Vec will be returned, not RetrieveZoneError::NotFound.

Source

fn get_zone( &self, zone_id: &str, ) -> impl Future<Output = Result<Self::Zone, RetrieveZoneError<Self::CustomRetrieveError>>>

Retrieves a zone by its provider-specific ID.
Refer to the provider’s documentation to figure out which value is used as the ID.

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§