Expand description
§plushie-widget-sdk
The public SDK for plushie. Widget authors depend on this crate to
implement the PlushieWidget trait and
build custom native widgets. The prelude module re-exports
everything a widget author needs; iced is re-exported so widgets
don’t need a direct iced dependency.
Beyond the public widget-author surface, this crate also re-exports
the widget infrastructure that the renderer crates and the Rust SDK
direct-mode runner need internally. Those re-exports live in
runtime and are not part of the widget-author API.
§Dependencies
Widget crates need both plushie-widget-sdk and plushie-core
as direct dependencies. The widget derive macros
(#[derive(WidgetEvent)], #[derive(WidgetCommand)],
#[derive(WidgetProps)], #[derive(PlushieWidget)]) emit code
that references ::plushie_core::* paths.
§iced stability
iced is re-exported as a transitive dependency. iced surfaces may
change on any plushie minor release. For stable semantics, prefer
prelude names and iced_convert conversions; reach into
plushie_widget_sdk::iced::* only for iced-specific constructs
that are not in the prelude.
§Module guide
Widget-author API:
prelude- common re-exports for widget authorsregistry-PlushieWidgettrait,WidgetRegistry,WidgetSet,InitCtx,GenerationCounterapp-PlushieAppBuilderfor registering widgetsprop_helpers- public prop extraction helpersrender_ctx-render_ctx::RenderCtx, the core rendering context for all widgetstesting- test factory helpers
Renderer-internal support API:
runtime- widget messages, theme resolution, built-in widget set, validation flag, render entry point, and canvas query helpersprotocol- wire protocol facade overplushie-coreimage_registry- image handle cache used byrender_ctx::RenderCtx
The renderer state engine, retained tree, and wire codec live in the
sibling crate plushie-renderer-engine; widget authors do not
depend on it.
Private implementation modules:
message, widget, and theming
Re-exports§
pub use iced;
Modules§
- animation
- Animation system: renderer-side transitions, springs, sequences, and exit ghosts.
- app
- Application builder for registering widgets.
- canvas_
engine - Reusable canvas rendering engine for PlushieWidget composition.
- diagnostics
- Re-export of
plushie_core::diagnosticsfor convenience so widget crates that already depend onplushie-widget-sdkdon’t need a second direct dep onplushie-corejust for diagnostic emission. Diagnostic emission hook. - fonts
- Loaded-font registry.
- iced_
convert - Conversion layer from plushie-core types to iced types.
- image_
registry - In-memory image handle storage.
- prelude
- Common re-exports for widget authors.
- prop_
helpers - Public prop extraction helpers for widget authors.
- protocol
- Wire protocol types for host-renderer communication.
- registry
- Unified widget dispatch:
PlushieWidgettrait,WidgetRegistry,WidgetSet. - render_
ctx - Core rendering context passed through the widget dispatch pipeline.
- runtime
- Renderer-internal support surface.
- shared_
state - Shared renderer state and cross-cutting cache management.
- testing
- Test factory helpers for widget authors.
Constants§
- BUILTIN_
TYPE_ NAMES - Sorted list of every built-in widget type name reserved by the stock renderer’s iced widget set.
Traits§
- Plushie
Renderer - Trait alias for renderer types that can be used with the plushie widget pipeline.
Type Aliases§
- Plushie
Element - Convenience alias for the
Elementtype returned byPlushieWidget::render.
Derive Macros§
- Plushie
Widget - Generate
type_namesandfresh_for_sessionfor aPlushieWidgetimpl, and re-declare the impl block with those methods injected. - Widget
Command - Typed command declarations for widget operations.
- Widget
Event - Typed event declarations for composite widgets.
- Widget
Props - Define your widget’s properties and get typed extraction.