Module prelude Copy item path Source pub use freya_router ;routerpub use crate::components ::*;data emittable executor measurer name platform AccessibilityData AccessibilityId The stable identity of a [Node], unique within the node’s tree. AccessibilityState AnimationClock Border BorderWidth Bytes A cheaply cloneable and sliceable chunk of contiguous memory. Callback Clipboard Access the clipboard. Color Represents one color.
You may create Color s using ConicGradient CornerRadius Cursor CursorStyleData Effect EffectData EffectState Event EventHandler EventsCombos FileEventData Focus FontWeight FontWidth FutureTask Gaps GradientStop ImePreeditEventData KeyboardEventData Data of a Keyboard event. Label LaunchConfig Launch configuration. LayerState LayoutData LinearGradient Memo Modifiers Pressed modifier keys. MouseEventData NoArgCallback Paragraph ParagraphHolder Platform RadialGradient ReactiveContext Readable A type-erased readable state that only exposes the value type T. Rect RenderContext RendererContext RenderingTicker Scale ScreenReader Shadow SizedEventData Data of a Sized event. Span State A reactive state container that holds a value of type T and manages subscriptions to changes. StyleState Svg SvgBytes SVG bytes that can be constructed from Bytes , Vec<u8> , &'static [u8],
or &'static [u8; N] (the type returned by include_bytes! ). Task TaskHandle TaskId TaskWaker TextShadow TextStyleData TextStyleState TouchEventData Data of a Touch event. UseId WheelEventData Data of a Wheel event. WindowConfig Configuration for a Window. Writable A type-erased writable state that only exposes the value type T. AccessibilityFocusMovement Strategy focusing an Accessibility Node. AccessibilityFocusStrategy Strategy focusing an Accessibility Node. AccessibilityRole The type of an accessibility node. Alignment AspectRatio BorderAlignment BorderShape ClipboardError CloseDecision Decision returned by the on_close hook to determine whether a window should close. Code Code is the physical position of a key. Content CursorIcon Describes the appearance of the (usually mouse) cursor icon. CursorMode Determines how the cursor and highlights are positioned within a Paragraph. CursorStyle DiffKey Direction Element EventType Fill FocusStatus Focusable FontSlant Force FutureState ImageCover Interactive Key The value received from the keypress. Layer MouseButton NamedKey Key represents the meaning of a keypress. NavigationMode Overflow PointerEventData Data of a pointer event. Position PreferredTheme PressEventData PressEventType ReadableRef SamplingMode ShadowPosition Size TextAlign TextHeightBehavior TextOverflow TextWidth TouchPhase UserEvent VerticalAlign Vertical alignment for Paragraph text rendering. VisibleSize WheelSource AccessibilityExt AlignmentExt App App is a trait for root-level application components.
Types implementing App automatically implement Component and have a
blanket PartialEq implementation that always returns true.ChildrenExt Component Encapsulate reusable pieces of UI by using the Component trait.
Every Component creates a new layer of state in the app,
meaning that implementors of Component can make use of hooks in their Component::render method. ComponentKey ComponentOwned ContainerExt ContainerSizeExt ContainerWithContentExt ContentExt CornerRadiusExt DebugExt DirectionExt EffectExt EventHandlersExt ImageExt InteractiveExt IntoElement IntoReadable IntoWritable KeyExt LayerExt LayoutExt ListExt MaybeExt ScrollableExt SizeExt StyleExt TextStyleExt VisibleSizeExt WindowDragExt WinitPlatformExt consume_context consume_root_context current_scope_id label Draw text with label() . Its a simplified version of crate::elements::paragraph . launch mark_scope_as_dirty paragraph paragraph() makes it possible to render rich text with different styles. Its a more customizable API than crate::elements::label .provide_context provide_context_for_scope_id rect rect() acts as a generic container to contain other elements inside, like a box.spawn spawn_forever svg Use svg() to render SVG in your app. try_consume_context try_consume_context_from_scope_id try_consume_root_context use_after_side_effect use_consume Get access to a value stored in this component instance or some ancestor. use_drop Run a callback for when the component gets dropped. Useful to clean resources. use_focus use_focus_status use_future Creata FutureTask with the given callback. use_hook This is the foundational hook used by all. It’s simple, it accepts an initialization callback
whose return value will be stored in this component instance until its dropped.
In subsequent renders the returned value of the function will be a Clone d value of what
had been previously returned by the initialization callback. use_id Get a unique for a given generic type. use_memo Registers a callback that will run every time a State which was .read() inside, changes.
It also returning a type that will get cached after the callback runs, thus allowing this to be used as a way to cache expensive values. use_previous_and_current Track the previous and current values of a reactive value. use_provide_context Store the given value in this component instance.
Any descendant component of this component calling use_consume or consume_context will have access to it. use_reactive Convert a borrowed value (&T) into a component-scoped State<T> . use_side_effect Registers a callback that will run every time a State which was .read() inside, changes. use_side_effect_value use_side_effect_with_deps use_state Creates a reactive state value initialized with the returned value of the init callback. use_try_consume Try to get access to a value stored in this component instance or some ancestor. Area Area used by a Node, including its margins. CursorPoint ReadRef Size2D WriteRef