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
Required Associated Types§
Sourcetype CustomRetrieveError: Debug
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§
Sourcefn list_zones(
&self,
) -> impl Future<Output = Result<Vec<Self::Zone>, RetrieveZoneError<Self::CustomRetrieveError>>>
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
.
Sourcefn get_zone(
&self,
zone_id: &str,
) -> impl Future<Output = Result<Self::Zone, RetrieveZoneError<Self::CustomRetrieveError>>>
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.