pub struct ComponentNamespace { /* private fields */ }Expand description
The component ids a document’s names may be namespaced by, level by level
(owner 2026-11-27): the document’s own components, and under each the
components of THAT component’s part document, so a nested chain
Motor:Shaft:F1_PZ is read one level at a time. A segment is a component
when it is registered at its level or has the ACOMP<n> / pattern-instance
shape (is_component_reference), so every name that split before splits
exactly as it did; a registered id frees a component from the shape.
Implementations§
Source§impl ComponentNamespace
impl ComponentNamespace
Sourcepub fn new() -> ComponentNamespace
pub fn new() -> ComponentNamespace
An empty namespace: only the shape rule applies.
Sourcepub fn insert(&mut self, id: impl Into<String>, inner: ComponentNamespace)
pub fn insert(&mut self, id: impl Into<String>, inner: ComponentNamespace)
Register component id at this level, its part’s own components as inner.
Sourcepub fn inner(&self, id: &str) -> Option<&ComponentNamespace>
pub fn inner(&self, id: &str) -> Option<&ComponentNamespace>
The namespace of component id’s part, when id is registered here.
Sourcepub fn is_component(&self, name: &str) -> bool
pub fn is_component(&self, name: &str) -> bool
Whether name is a component at this level: registered, or of the shape.
Sourcepub fn split<'a>(&self, name: &'a str) -> (Vec<&'a str>, &'a str)
pub fn split<'a>(&self, name: &'a str) -> (Vec<&'a str>, &'a str)
split_component_namespace read against this namespace: each segment
is checked at its own level (a registered component’s part’s ids below
it; past a shape-only segment, the shape rule alone).
Sourcepub fn names_component(&self, name: &str) -> bool
pub fn names_component(&self, name: &str) -> bool
Whether name names a whole component (a bare id, or a nested chain
ending in one): what is_component_reference answers for the local
part of a split by shape.
Trait Implementations§
Source§impl Clone for ComponentNamespace
impl Clone for ComponentNamespace
Source§fn clone(&self) -> ComponentNamespace
fn clone(&self) -> ComponentNamespace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ComponentNamespace
impl Debug for ComponentNamespace
Source§impl Default for ComponentNamespace
impl Default for ComponentNamespace
Source§fn default() -> ComponentNamespace
fn default() -> ComponentNamespace
impl Eq for ComponentNamespace
Source§impl PartialEq for ComponentNamespace
impl PartialEq for ComponentNamespace
impl StructuralPartialEq for ComponentNamespace
Auto Trait Implementations§
impl Forget for ComponentNamespace
impl Freeze for ComponentNamespacewhere
*const LeafNode<String, ComponentNamespace> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, ComponentNamespace)>>: Freeze,
impl Move for ComponentNamespace
impl RefUnwindSafe for ComponentNamespace
impl Send for ComponentNamespacewhere
NodeRef<Owned, String, ComponentNamespace, LeafOrInternal>: Send,
BoxRaw<(String, ComponentNamespace)>: Send,
impl Sync for ComponentNamespacewhere
NodeRef<Owned, String, ComponentNamespace, LeafOrInternal>: Sync,
BoxRaw<(String, ComponentNamespace)>: Sync,
impl Unpin for ComponentNamespacewhere
*const LeafNode<String, ComponentNamespace> is !null: Unpin,
Box<(String, ComponentNamespace)>: Unpin,
impl UnsafeUnpin for ComponentNamespacewhere
*const LeafNode<String, ComponentNamespace> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, ComponentNamespace)>>: UnsafeUnpin,
impl UnwindSafe for ComponentNamespace
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.