#[repr(C)]pub struct ComponentMap {
pub libraries: ComponentLibraryVec,
}Expand description
The component map — holds libraries with namespaced components.
Fields§
§libraries: ComponentLibraryVecLibraries indexed by name. “builtin” is always present.
Implementations§
Source§impl ComponentMap
impl ComponentMap
Sourcepub fn get(&self, collection: &str, name: &str) -> Option<&ComponentDef>
pub fn get(&self, collection: &str, name: &str) -> Option<&ComponentDef>
Qualified lookup: “shadcn:avatar” -> finds library “shadcn”, component “avatar”
Sourcepub fn get_unqualified(&self, name: &str) -> Option<&ComponentDef>
pub fn get_unqualified(&self, name: &str) -> Option<&ComponentDef>
Unqualified lookup: “div” -> searches ONLY the “builtin” library.
Sourcepub fn get_by_qualified_name(&self, qualified: &str) -> Option<&ComponentDef>
pub fn get_by_qualified_name(&self, qualified: &str) -> Option<&ComponentDef>
Parse a “collection:name” string into a lookup
Sourcepub fn get_exportable_libraries(&self) -> Vec<&ComponentLibrary>
pub fn get_exportable_libraries(&self) -> Vec<&ComponentLibrary>
Get all libraries that can be exported (user-defined only)
Sourcepub fn all_components(&self) -> Vec<&ComponentDef>
pub fn all_components(&self) -> Vec<&ComponentDef>
Get all component definitions across all libraries
Source§impl ComponentMap
impl ComponentMap
pub fn create() -> Self
Sourcepub fn with_builtin() -> Self
pub fn with_builtin() -> Self
Create a ComponentMap with the 52 built-in HTML element components pre-registered.
Sourcepub fn from_libraries(libs: &ComponentLibraryVec) -> Self
pub fn from_libraries(libs: &ComponentLibraryVec) -> Self
Build a ComponentMap from the libraries stored in an AppConfig.
The component_libraries field already contains builtins (registered in
AppConfig::create()) plus any user-added libraries. No merging needed —
add_component_library / add_component handle insertion at registration time.
Trait Implementations§
Source§impl Clone for ComponentMap
impl Clone for ComponentMap
Source§fn clone(&self) -> ComponentMap
fn clone(&self) -> ComponentMap
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more