pub struct SurfaceComponentsModel { /* private fields */ }Expand description
Manages all components in a surface as a flat HashMap.
Implementations§
Source§impl SurfaceComponentsModel
impl SurfaceComponentsModel
pub fn new() -> Self
Sourcepub fn get(&self, id: &str) -> Option<&ComponentModel>
pub fn get(&self, id: &str) -> Option<&ComponentModel>
Get a component by ID.
Sourcepub fn upsert(&mut self, component: ComponentModel)
pub fn upsert(&mut self, component: ComponentModel)
Add or update a component. If the component already exists with a different type, replaces it.
Sourcepub fn all(&self) -> &HashMap<String, ComponentModel>
pub fn all(&self) -> &HashMap<String, ComponentModel>
Get all components.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SurfaceComponentsModel
impl RefUnwindSafe for SurfaceComponentsModel
impl Send for SurfaceComponentsModel
impl Sync for SurfaceComponentsModel
impl Unpin for SurfaceComponentsModel
impl UnsafeUnpin for SurfaceComponentsModel
impl UnwindSafe for SurfaceComponentsModel
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