Trait Zone

Source
pub trait Zone {
    type CustomRetrieveError: Debug;

    // Required methods
    fn id(&self) -> &str;
    fn domain(&self) -> &str;
    fn list_records(
        &self,
    ) -> impl Future<Output = Result<Vec<Record>, RetrieveRecordError<Self::CustomRetrieveError>>>;
    fn get_record(
        &self,
        record_id: &str,
    ) -> impl Future<Output = Result<Record, RetrieveRecordError<Self::CustomRetrieveError>>>;
}
Expand description

Represents a DNS zone.

DNS zones are provided by a DNS Provider and implement Record management. By default, only record retrieval is supported, but the following capabilities may be implemented to allow further record management:

Required Associated Types§

Source

type CustomRetrieveError: Debug

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

Required Methods§

Source

fn id(&self) -> &str

Returns the provider-specific ID of the zone.

Source

fn domain(&self) -> &str

Returns the domain the zone manages.

Source

fn list_records( &self, ) -> impl Future<Output = Result<Vec<Record>, RetrieveRecordError<Self::CustomRetrieveError>>>

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

Source

fn get_record( &self, record_id: &str, ) -> impl Future<Output = Result<Record, RetrieveRecordError<Self::CustomRetrieveError>>>

Retrieves a record 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§