pub struct IdCatalog {
pub schema_version: u32,
pub declarations: Vec<IdDeclaration>,
}Fields§
§schema_version: u32§declarations: Vec<IdDeclaration>Implementations§
Source§impl IdCatalog
impl IdCatalog
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Check the catalog’s schema version and that each family is declared once.
§Errors
Returns an error when the schema version is not 1 or two declarations share a family.
Sourcepub fn resolve(&self, id: &str) -> Result<&IdDeclaration, String>
pub fn resolve(&self, id: &str) -> Result<&IdDeclaration, String>
Find the declaration that the element ID id belongs to.
§Errors
Returns an error when the ID’s family is not declared, the ID is keyed where the declaration is static (or the reverse), or its key is not canonical percent-encoded UTF-8.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for IdCatalog
impl<'de> Deserialize<'de> for IdCatalog
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
impl Eq for IdCatalog
impl StructuralPartialEq for IdCatalog
Auto Trait Implementations§
impl Forget for IdCatalog
impl Freeze for IdCatalog
impl Move for IdCatalog
impl RefUnwindSafe for IdCatalog
impl Send for IdCatalog
impl Sync for IdCatalog
impl Unpin for IdCatalog
impl UnsafeUnpin for IdCatalog
impl UnwindSafe for IdCatalog
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.