pub struct ElementIdRef<'a> {
pub kind: &'a str,
pub segment: &'a str,
pub id: &'a str,
}Expand description
The parsed shape of an element id (ADR-0116 §7):
<kind>:<segment>:<n|r><id>. This is the one parser for that three-part
structure, shared by USE graph.byElementId(...) resolution and
db.nameFromElementId; it only splits the shape — callers decide how
much of it to validate (db.nameFromElementId checks the kind prefix
and rejects an empty entity segment, but deliberately does not validate
the entity segment’s contents).
Fields§
§kind: &'a strThe first segment: the element kind (4 node, 5 relationship).
segment: &'a strThe middle segment: names the namespace, dash-bearing
(ADR-0554): rl-id or rl-onto.
id: &'a strThe third segment: the entity reference (n<id> / r<id>), opaque.
Implementations§
Source§impl<'a> ElementIdRef<'a>
impl<'a> ElementIdRef<'a>
Sourcepub fn parse(id: &'a str) -> Option<ElementIdRef<'a>>
pub fn parse(id: &'a str) -> Option<ElementIdRef<'a>>
Split an element id into its three colon-separated segments, or
None when it does not have exactly that shape.
Sourcepub fn has_known_kind(&self) -> bool
pub fn has_known_kind(&self) -> bool
Whether the first segment names an element kind the engine writes —
the one place the kind digit is resolved against
[ElementKind]’s vocabulary, so a caller never re-spells it.
Trait Implementations§
Source§impl<'a> Clone for ElementIdRef<'a>
impl<'a> Clone for ElementIdRef<'a>
impl<'a> Copy for ElementIdRef<'a>
Source§impl<'a> Debug for ElementIdRef<'a>
impl<'a> Debug for ElementIdRef<'a>
impl<'a> Eq for ElementIdRef<'a>
Source§impl<'a> PartialEq for ElementIdRef<'a>
impl<'a> PartialEq for ElementIdRef<'a>
impl<'a> StructuralPartialEq for ElementIdRef<'a>
Auto Trait Implementations§
impl<'a> Forget for ElementIdRef<'a>
impl<'a> Freeze for ElementIdRef<'a>
impl<'a> Move for ElementIdRef<'a>
impl<'a> RefUnwindSafe for ElementIdRef<'a>
impl<'a> Send for ElementIdRef<'a>
impl<'a> Sync for ElementIdRef<'a>
impl<'a> Unpin for ElementIdRef<'a>
impl<'a> UnsafeUnpin for ElementIdRef<'a>
impl<'a> UnwindSafe for ElementIdRef<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.