Skip to main content

Crate component_shape_gpui

Crate component_shape_gpui 

Source
Expand description

GPUI-specific component shape runtime contracts.

This crate is also the GPUI facade for shared component-shape metadata such as ComponentShapeMetadata, ValueChange, and McpInput.

Declare owned components with the GpuiComponentShape derive and external component/state pairs with component_shape!. Consumer-side configured values implement GpuiComponentShapeBuilder and share the build_component_shape construction path with DefaultGpuiComponentShapeBuilder.

Macros§

component_shape
Function-like macro for declaring a local GPUI component shape around external component/state types.

Structs§

ComponentCapabilities
Shape-owned capability flags consumed by generators and integrations.
ComponentPrototyping
Shape-owned metadata for prototyping generators.
ComponentSuffix
Preferred generated component helper suffix.
DefaultGpuiComponentShapeBuilder
Default builder for a shape’s normal GpuiComponentShape::new behavior.
McpInput
Shape-owned metadata for model-controlled MCP input.
NoGpuiRenderComponent
Marker render contract for shapes that do not publish render metadata.

Enums§

McpInputShape
Framework-neutral shape of structured MCP input accepted by a component.
McpPrimitiveKind
Primitive value kinds a component shape can expose to model-controlled tools.
McpRangeBoundKind
Primitive kinds that can be used as { "min": ..., "max": ... } MCP range bounds.
RenderCapability
Whether a component shape publishes render-component metadata.
ValueBindingCapability
Whether a component shape publishes value-binding metadata.
ValueChange
Normalized value change derived from a component event.

Traits§

ComponentShapeFor
Marker that a component shape supports a value or field type.
ComponentShapeMetadata
Framework-neutral metadata published by a component shape.
DeclaredComponentShape
Marker for component shapes declared through a trusted declaration surface.
DeclaredGpuiComponentShape
Marker for component shapes declared through component-shape GPUI macros.
GpuiComponentRender
Renders a component UI value from a component state entity.
GpuiComponentShape
Shape contract for GPUI components.
GpuiComponentShapeBuilder
Configured builder for a GPUI component shape.
GpuiComponentShapeFor
Marker that a GPUI component shape supports a value type.
GpuiComponentStateValueBinding
Value-binding contract implemented by backing component state.
GpuiComponentValueBinding
Optional value-binding contract for GPUI component shapes.

Functions§

build_component_shape
Build component state from a configured shape builder.
component_suffix_from_suffix
Derive a generated helper suffix from a field name and shape suffix source.
is_valid_component_suffix
Returns whether a component/prototyping suffix is valid.
seed_value_binding_state
Seed component state from the current value without spelling out the associated-type projection at every generated call site.
validate_component_suffix
Validate a component/prototyping suffix.
value_change
Convert a component event into a value change without repeating UFCS projections in generated code.

Type Aliases§

GpuiComponentEventOf
Event type for a value-bound GPUI component shape and value.
GpuiComponentStateOf
State type for a GPUI component shape.

Derive Macros§

GpuiComponentShape
Derive macro for GPUI component shape metadata.