Skip to main content

Crate rust_constructor

Crate rust_constructor 

Source
Expand description

§Rust Constructor V2

A cross-platform GUI framework built on egui, the simplest way to develop GUI projects with Rust

基于egui构建的跨平台GUI框架, 用Rust开发GUI项目最简单的方式

§Overview 概述

Rust Constructor is a fully functional GUI framework that leverages the power of egui to provide a simple and intuitive instrument for building cross-platform applications.

Rust Constructor是一个功能全面的GUI框架,它利用了egui的强大功能,为构建跨平台应用程序提供了一个简单直观的工具。

§Quick Start 快速入门

pub struct RcApp {
    pub inner: rust_constructor::app::App,
}

impl eframe::App for RcApp {
    fn update(&mut self, ctx: &egui::Context, _: &mut eframe::Frame) {
        egui::CentralPanel::default().show(ctx, |ui| {
            ui.label("Hello world");
        });
    }
}


eframe::run_native(
    "Example App",
    eframe::NativeOptions::default(),
    Box::new(|_| {
        Ok(Box::new(RcApp {
            inner: rust_constructor::app::App::default(),
        }))
    }),
)
.unwrap();

§Documentation 文档

Modules§

advance_front
This file contains advanced front-end resources, which can be used to handle complex tasks.
app
Main application struct containing all GUI resources and state management.
background
This file contains backend resources, which can store some key data and be called upon when needed.
basic_front
This file contains basic front resources. Basic front resources can be used independently or to create advanced front-end resources.

Structs§

BasicFrontResourceConfig
Config for basic front resources.
DisplayInfo
Display config for resources, controlling visibility and rendering behavior.
PositionSizeConfig
Config for positioning and sizing resources in a flexible grid system.
RustConstructorError
Error type for Rust Constructor framework.
RustConstructorId
Unique identifier for Rust Constructor resources.
RustConstructorResourceBox
Container for Rust Constructor resources with type-erased storage.
Timer
Timer for tracking application and page runtimes.

Enums§

BorderKind
Defines the placement of borders relative to the element’s bounds.
HorizontalAlign
Horizontal alignment options for UI elements.
ListInfoMethod
Methods for displaying list information.
RenderConfig
Config for rendering.
RequestMethod
The lookup method for requesting resources to skip the rendering queue.
RequestType
Types of rendering layer requests.
VerticalAlign
Vertical alignment options for UI elements.

Traits§

BasicFrontResource
Trait for managing basic front resources that are displayed to the user.
RustConstructorResource
Core trait for managing Rust Constructor resources uniformly.