ui
Generated Rust API reference for byte_engine.
Module ui
Retained UI components, layout evaluation, styling, and rendering.
Implement an async component function to describe a UI tree and evaluate it with
layout::engine::Engine. Components create Container, Text, and
other Primitive values through the layout context. Send the resulting
layout::engine::Render data to render_pass::UiRenderPass when
integrating UI into a graphics application.
See the GUI guide for component, layout, event, focus, and rendering guidance.
Contents
Quick Reference
| Item | Kind | Description |
|---|---|---|
element | mod | Concrete UI elements emitted by layout components. |
ConcreteElement | struct | |
UiPoint | struct | |
UiVector | struct | |
Element | trait | |
ElementHandle | trait | |
Id | type |
Modules
element— Concrete UI elements emitted by layout components.
Structs
ConcreteElement
struct ConcreteElement {
// [REDACTED: Private Fields]
}Defined in crates/byte-engine/src/ui/element.rs:38-40
The ConcreteElement struct stores one built-in primitive produced by a
layout component.
Implementations
-
fn container(container: Container) -> SelfRelated:
ContainerCreates an element backed by a container primitive.
-
fn shape(shape: Shape) -> SelfCreates an element backed by a shape primitive.
-
fn curve(curve: Curve) -> SelfRelated:
CurveCreates an element backed by a curve primitive.
-
fn image(image: Image) -> SelfRelated:
ImageCreates an element backed by an image primitive.
-
fn text(text: Text) -> SelfRelated:
TextCreates an element backed by a text primitive.
-
fn text_field(text_field: TextField) -> SelfRelated:
TextFieldCreates an element backed by a text field primitive.
Trait Implementations
impl ArchivePointee for ConcreteElement
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for ConcreteElement
impl Downcast for ConcreteElement
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl Instrument for ConcreteElement
impl LayoutRaw for ConcreteElement
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for ConcreteElement
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointable for ConcreteElement
-
const ALIGN: usize -
type Init = T -
unsafe fn init(init: <T as Pointable>::Init) -> usize -
unsafe fn deref<'a>(ptr: usize) -> &'a T -
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T -
unsafe fn drop(ptr: usize)
impl Pointee for ConcreteElement
-
type Metadata = ()
impl Read for ConcreteElement
impl WithSubscriber for ConcreteElement
UiPoint
struct UiPoint {
pub x: f32,
pub y: f32,
}Defined in crates/byte-engine/src/ui/point.rs:9-14
The UiPoint struct carries a two-dimensional UI position.
Use UiPoint for normalized pointer positions and layout-local points. It
deliberately has no world-space meaning. Next, pass it to
crate::ui::Engine::set_cursor_position.
Fields
-
x:f32The horizontal UI coordinate.
-
y:f32The vertical UI coordinate.
Implementations
-
const fn new(x: f32, y: f32) -> SelfCreates a UI position from horizontal and vertical coordinates.
-
const fn zero() -> SelfReturns the UI origin.
Trait Implementations
impl ArchivePointee for UiPoint
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for UiPoint
impl Clone for UiPoint
-
fn clone(&self) -> UiPointRelated:
UiPoint
impl Copy for UiPoint
impl Debug for UiPoint
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for UiPoint
-
fn default() -> UiPointRelated:
UiPoint
impl Downcast for UiPoint
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSend for UiPoint
-
fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>
impl DowncastSync for UiPoint
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>
impl Instrument for UiPoint
impl LayoutRaw for UiPoint
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for UiPoint
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for UiPoint
-
fn eq(&self, other: &UiPoint) -> boolRelated:
UiPoint
impl Pointable for UiPoint
-
const ALIGN: usize -
type Init = T -
unsafe fn init(init: <T as Pointable>::Init) -> usize -
unsafe fn deref<'a>(ptr: usize) -> &'a T -
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T -
unsafe fn drop(ptr: usize)
impl Pointee for UiPoint
-
type Metadata = ()
impl Read for UiPoint
impl<R> ReadPrimitive for UiPoint
impl StructuralPartialEq for UiPoint
impl WithSubscriber for UiPoint
UiVector
struct UiVector {
pub x: f32,
pub y: f32,
}Defined in crates/byte-engine/src/ui/point.rs:35-40
The UiVector struct carries a two-dimensional UI displacement.
Use UiVector for scroll input and spatial-navigation axes. It deliberately
has no world-space meaning. Next, pass it to
crate::ui::Engine::update_scroll_state or
crate::ui::layout::snapshot::Snapshot::move_cursor.
Fields
-
x:f32The horizontal UI displacement.
-
y:f32The vertical UI displacement.
Implementations
-
const fn new(x: f32, y: f32) -> SelfCreates a UI displacement from horizontal and vertical components.
-
const fn zero() -> SelfReturns the neutral UI displacement.
Trait Implementations
impl ArchivePointee for UiVector
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for UiVector
impl Clone for UiVector
-
fn clone(&self) -> UiVectorRelated:
UiVector
impl Copy for UiVector
impl Debug for UiVector
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for UiVector
-
fn default() -> UiVectorRelated:
UiVector
impl Downcast for UiVector
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSend for UiVector
-
fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>
impl DowncastSync for UiVector
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>
impl Instrument for UiVector
impl LayoutRaw for UiVector
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for UiVector
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for UiVector
-
fn eq(&self, other: &UiVector) -> boolRelated:
UiVector
impl Pointable for UiVector
-
const ALIGN: usize -
type Init = T -
unsafe fn init(init: <T as Pointable>::Init) -> usize -
unsafe fn deref<'a>(ptr: usize) -> &'a T -
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T -
unsafe fn drop(ptr: usize)
impl Pointee for UiVector
-
type Metadata = ()
impl Read for UiVector
impl<R> ReadPrimitive for UiVector
impl StructuralPartialEq for UiVector
impl WithSubscriber for UiVector
Traits
Element
trait Element { ... }Defined in crates/byte-engine/src/ui/element.rs:20-23
The Element trait exposes the primitive represented by a UI element.
Required Methods
-
fn primitive(&self) -> BasePrimitiveReturns the primitive that layout and rendering systems consume.
ElementHandle
trait ElementHandle { ... }Defined in crates/byte-engine/src/ui/element.rs:31-34
The ElementHandle trait exposes the stable identity assigned during layout.
Required Methods
-
fn id(&self) -> IdReturns the layout identity for this element.
Type Aliases
Id
type Id = std::num::NonZeroU32;Defined in crates/byte-engine/src/ui/element.rs:28
Stable non-zero identifier assigned to UI elements during layout.