Reference
Structs
Index of crate-level iced structs exposed in rustdoc.
Structs
Crate-level structs include geometry/style primitives (Point, Size, Color, Border) and runtime building blocks (Task, Subscription, Settings).
# Use this when...
- You need explicit Iced types in app state or helper APIs.
- You are configuring runtime/layout/styling with strongly typed values.
- You want to understand trait bounds and ownership of core runtime types.
# Minimal example
rust
let padding = iced::Padding::from(12); let color = iced::Color::from_rgb8(0x33, 0x66, 0x99);
# How it works
These types are used across many modules, so understanding them improves all widget/runtime work. Runtime structs (Task, Subscription, Settings) are especially important for app architecture.
# Common patterns
rust
fn refresh() -> iced::Task<Message> { iced::Task::perform(load(), Message::Loaded) }
# Gotchas / tips
- Use Iced structs directly instead of loosely typed primitives when available.
- Keep runtime structs near app bootstrap/update logic, not deeply buried in UI helpers.
- Geometry/style structs are cheap clarity wins for maintainability.
# Struct Index
- Animation
- Border
- Color
- Degrees
- Font
- Padding
- Pixels
- Point
- Preset
- Radians
- Rectangle
- Settings
- Shadow
- Size
- Subscription
- Task
- Transformation
- Vector