Skip to main content

Described

Trait Described 

pub trait Described:
    Sized
    + Widget
    + 'static {
    type Props: Component;

    // Required method
    fn from_props(key: &str, props: Self::Props) -> Self;

    // Provided methods
    fn set_props(&mut self, props: Self::Props) -> bool { ... }
    fn slot_views(&mut self, slot: &str) -> Option<&mut dyn SlotViews> { ... }
    fn part_views(
        &mut self,
        slot: &str,
        key: &str,
        of: &str,
    ) -> Option<&mut dyn SlotViews> { ... }
}
Expand description

A widget made from props.

A described widget answers its own type through crate::widget::Widget::as_any_mut: the adapter reaches it with that to change its props in place, and a widget that answers no type is built again on every change it is told about. Declare the answer inside its Widget impl with crate::described!.

Required Associated Types§

Required Methods§

fn from_props(key: &str, props: Self::Props) -> Self

The widget of props, with key its stable id.

Provided Methods§

fn set_props(&mut self, props: Self::Props) -> bool

Take changed props in place, damaging what they change: false when this widget cannot and is to be built again.

fn slot_views(&mut self, slot: &str) -> Option<&mut dyn SlotViews>

The views of its slot slot, to change by key in place: None when a change of what the slot holds builds the widget again.

fn part_views( &mut self, slot: &str, key: &str, of: &str, ) -> Option<&mut dyn SlotViews>

The views its slot slot holds for the part key — a part being a component the slot takes, whose props the widget reads — in that part’s own view slot of, to change them by key where they stand. None when a change inside a part builds the widget again.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl Described for BarGauge

§

impl Described for Sparkline

§

type Props = SparklineProps

§

impl Described for Banner

§

impl Described for Button

§

impl Described for Checkbox

§

impl Described for Dropdown

§

impl Described for EmptyState

§

impl Described for NumberInput

§

impl Described for QrWidget

§

impl Described for Scrollable

§

impl Described for Slider

§

impl Described for Spinner

§

impl Described for Text

§

impl Described for TextInput

§

impl Described for Toggle

§

impl Described for SearchButton

§

impl Described for Card

§

impl Described for EditableLabel

§

impl Described for NavList

§

impl Described for NavShell

§

impl Described for Section

§

impl Described for Autocomplete

§

impl Described for Avatar

§

impl Described for Badge

§

impl Described for BarChip

§

impl Described for BlockEditor

§

impl Described for Board

§

impl Described for Breadcrumb

§

impl Described for ChangeMark

§

impl Described for Chip

§

impl Described for ChromeBody

§

impl Described for CodeEditor

§

impl Described for ColorPicker

§

impl Described for ColorSwatchPicker

§

impl Described for ControlRow

§

impl Described for CropEditor

§

impl Described for DateField

§

impl Described for DatePicker

§

impl Described for DeclaredLine

§

impl Described for DeclaredModal

§

impl Described for DeclaredPanel

§

impl Described for DeclaredPopover

§

impl Described for DeclaredPopoverButton

§

impl Described for DeclaredRail

§

impl Described for DeclaredTransport

§

impl Described for DeclaredVideo

§

impl Described for DescribedActivityTimeline

§

impl Described for DescribedCardGrid

§

impl Described for DescribedConversationList

§

impl Described for DescribedList

§

impl Described for DescribedTable

§

impl Described for DescribedTreeView

§

impl Described for DisclosureBand

§

impl Described for DisclosureRow

§

impl Described for Docked

§

impl Described for DragRun

§

impl Described for Drawing

§

impl Described for DropZone

§

impl Described for EmojiPickerButton

§

impl Described for EnumField

§

impl Described for Facts

§

impl Described for IconWidget

§

impl Described for Image

§

impl Described for InputHint

§

impl Described for KeyHints

§

impl Described for ListRow

§

impl Described for Map

§

impl Described for MediaGrid

§

impl Described for MenuButton

§

impl Described for ObjectHeader

§

impl Described for PagePreview

§

impl Described for PageSlide

§

impl Described for PersonField

§

impl Described for PictureChoice

§

impl Described for ProgressBar

§

impl Described for ProgressRing

§

impl Described for PropertyList

§

impl Described for Quote

§

impl Described for ReactionStripWidget

§

impl Described for RelativeTime

§

impl Described for RichInput

§

impl Described for ShortcutRecorder

§

impl Described for SignalMeter

§

impl Described for Skeleton

§

impl Described for StatGroup

§

impl Described for StatTile

§

impl Described for StatusLine

§

impl Described for Stepper

§

impl Described for TabStrip

§

impl Described for TextStack

§

impl Described for TimeField

§

impl Described for TimePicker

§

impl Described for ToggleGroup

§

impl Described for Toolbar

§

impl Described for UnreadDivider

§

impl Described for ViewTabs

§

impl Described for WebView

§

impl Described for WindowFrame

§

impl Described for WindowPreview

§

impl Described for WindowWell

§

impl Described for ZoomableImage