-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put related things together (in-memory store, errors, traits, types) …
…and don't use the internal version types of the in-memory store in public APIs.
- Loading branch information
Showing
21 changed files
with
788 additions
and
672 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//------------ ZoneCutError -------------------------------------------------- | ||
|
||
use std::fmt::Display; | ||
|
||
#[derive(Clone, Copy, Debug)] | ||
pub enum ZoneCutError { | ||
OutOfZone, | ||
ZoneCutAtApex, | ||
} | ||
|
||
impl From<OutOfZone> for ZoneCutError { | ||
fn from(_: OutOfZone) -> ZoneCutError { | ||
ZoneCutError::OutOfZone | ||
} | ||
} | ||
|
||
impl Display for ZoneCutError { | ||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { | ||
match self { | ||
ZoneCutError::OutOfZone => write!(f, "Out of zone"), | ||
ZoneCutError::ZoneCutAtApex => write!(f, "Zone cut at apex"), | ||
} | ||
} | ||
} | ||
|
||
//----------- CnameError ----------------------------------------------------- | ||
|
||
#[derive(Clone, Copy, Debug)] | ||
pub enum CnameError { | ||
OutOfZone, | ||
CnameAtApex, | ||
} | ||
|
||
impl From<OutOfZone> for CnameError { | ||
fn from(_: OutOfZone) -> CnameError { | ||
CnameError::OutOfZone | ||
} | ||
} | ||
|
||
impl Display for CnameError { | ||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { | ||
match self { | ||
CnameError::OutOfZone => write!(f, "Out of zone"), | ||
CnameError::CnameAtApex => write!(f, "CNAME at apex"), | ||
} | ||
} | ||
} | ||
|
||
//----------- OutOfZone ------------------------------------------------------ | ||
|
||
/// A domain name is not under the zone’s apex. | ||
#[derive(Clone, Copy, Debug)] | ||
pub struct OutOfZone; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.