pub struct DomainRegistry { /* private fields */ }Expand description
Registry for managing domain information.
Implementations§
Source§impl DomainRegistry
impl DomainRegistry
Sourcepub fn with_builtins() -> Self
pub fn with_builtins() -> Self
Create a registry with standard built-in domains.
Sourcepub fn register_or_replace(&mut self, domain: DomainInfo)
pub fn register_or_replace(&mut self, domain: DomainInfo)
Register a domain, overwriting if it exists.
Sourcepub fn get(&self, name: &str) -> Option<&DomainInfo>
pub fn get(&self, name: &str) -> Option<&DomainInfo>
Get domain information by name.
Sourcepub fn validate_domain(&self, name: &str) -> Result<&DomainInfo, IrError>
pub fn validate_domain(&self, name: &str) -> Result<&DomainInfo, IrError>
Validate that a domain exists.
Sourcepub fn are_compatible(
&self,
domain1: &str,
domain2: &str,
) -> Result<bool, IrError>
pub fn are_compatible( &self, domain1: &str, domain2: &str, ) -> Result<bool, IrError>
Check if two domains are compatible.
Sourcepub fn can_cast(&self, from: &str, to: &str) -> Result<bool, IrError>
pub fn can_cast(&self, from: &str, to: &str) -> Result<bool, IrError>
Check if domain1 can be cast to domain2.
Sourcepub fn domain_names(&self) -> Vec<String>
pub fn domain_names(&self) -> Vec<String>
Get all registered domain names.
Trait Implementations§
Source§impl Clone for DomainRegistry
impl Clone for DomainRegistry
Source§fn clone(&self) -> DomainRegistry
fn clone(&self) -> DomainRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DomainRegistry
impl Debug for DomainRegistry
Source§impl Default for DomainRegistry
impl Default for DomainRegistry
Source§fn default() -> DomainRegistry
fn default() -> DomainRegistry
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DomainRegistry
impl<'de> Deserialize<'de> for DomainRegistry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DomainRegistry
impl RefUnwindSafe for DomainRegistry
impl Send for DomainRegistry
impl Sync for DomainRegistry
impl Unpin for DomainRegistry
impl UnwindSafe for DomainRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more