gpui-entity
Installation
SKILL.md
Overview
An Entity<T> is a handle to state of type T, providing safe access and updates.
Key Methods:
entity.read(cx)→&T- Read-only accessentity.read_with(cx, |state, cx| ...)→R- Read with closureentity.update(cx, |state, cx| ...)→R- Mutable updateentity.downgrade()→WeakEntity<T>- Create weak referenceentity.entity_id()→EntityId- Unique identifier
Entity Types:
Entity<T>: Strong reference (increases ref count)WeakEntity<T>: Weak reference (doesn't prevent cleanup, returnsResult)