iced_core library holds basic types that can be reused and re-exported in different runtime implementations. It provides the fundamental building blocks for creating Iced applications.
Module Structure
The core library is organized into the following key modules:Layout and Positioning
- alignment - Align and position widgets
- layout - Layout computation
- padding - Padding configuration
- length - Space filling strategies
Rendering
- renderer - Renderer abstraction
- element - Generic widget wrapper
- widget - Widget trait and types
- overlay - Overlay rendering
Styling
- color - sRGB color representation
- background - Background styles
- border - Border configuration
- shadow - Shadow effects
- theme - Theming support
Input Handling
- event - Event types
- keyboard - Keyboard input
- mouse - Mouse interaction
- touch - Touch input
Graphics Primitives
- font - Font configuration
- text - Text rendering
- image - Image rendering
- svg - SVG rendering
- gradient - Gradient effects
Geometry
- point - 2D points
- vector - 2D vectors
- rectangle - Rectangles
- size - Size representation
- transformation - Geometric transformations
- rotation - Rotation angles
Key Types
The most commonly used core types include:Element- A generic widget wrapperAlignment- Alignment configurationLength- Space filling strategiesColor- sRGB color representationWidget- The base widget traitRenderer- The renderer traitTheme- Theming configuration
Utility Traits
Function Trait
TheFunction trait is a trait extension for binary functions that enables functional programming paradigms:
Never Type
Thenever function is used to coerce the Never type (an alias for std::convert::Infallible) into any type:
