Skip to main content

App

Struct App 

Source
pub struct App {
    pub rust_constructor_resource: Vec<RustConstructorResourceBox>,
    pub tick_interval: f32,
    pub current_page: String,
    pub timer: Timer,
    pub frame_times: Vec<f32>,
    pub last_frame_time: Option<f32>,
    pub basic_front_resource_list: Vec<String>,
    pub render_layer: Vec<(RustConstructorId, [[f32; 2]; 2], bool)>,
    pub active_list: Vec<RustConstructorId>,
    pub render_list: Vec<RustConstructorId>,
}
Expand description

程序主体。

Fields§

§rust_constructor_resource: Vec<RustConstructorResourceBox>

RC资源。

§tick_interval: f32

RC资源刷新率。

§current_page: String

当前页面。

§timer: Timer

计时器。

§frame_times: Vec<f32>

帧时间。

§last_frame_time: Option<f32>

上一帧时间。

§basic_front_resource_list: Vec<String>

标记哪些资源属于基本前端资源,此列表不应以任何形式进行修改。

§render_layer: Vec<(RustConstructorId, [[f32; 2]; 2], bool)>

标记渲染物件的层级和位置。

§active_list: Vec<RustConstructorId>

活跃资源列表。

§render_list: Vec<RustConstructorId>

渲染队列。

Implementations§

Source§

impl App

Source

pub fn tick_interval(self, tick_interval: f32) -> Self

Source

pub fn current_page(self, current_page: &str) -> Self

Source

pub fn get_tag( &self, tag_name: &str, target: &[[String; 2]], ) -> Option<(usize, String)>

从指定列表中获取标签。

Source

pub fn draw_resources(&mut self, ui: &mut Ui, ctx: &Context)

一次性绘制所有资源,会丢弃所有返回值,不建议使用。

Source

pub fn draw_resource_by_index( &mut self, ui: &mut Ui, ctx: &Context, index: usize, ) -> Result<(), RustConstructorError>

根据索引值绘制资源,建议使用for循环搭配。

Source

pub fn active_list_info(&self, method: ActiveListInfoMethod) -> String

打印资源活跃情况。

Source

pub fn render_layer_info(&self) -> String

打印渲染层级列表。

Source

pub fn render_list_info(&self) -> String

打印渲染队列。

Source

pub fn update_render_list(&mut self)

更新渲染队列。

Source

pub fn try_request_jump_render_list( &mut self, requester: RequestMethod, request_type: RequestType, )

请求在渲染队列中插队,且无视申请跳过队列的资源是否存在。

Source

pub fn request_jump_render_list( &mut self, requester: RequestMethod, request_type: RequestType, ) -> Result<(), RustConstructorError>

请求在渲染队列中插队。

Source

pub fn jump_render_list_processor( &mut self, requester_index: usize, request_type: RequestType, ) -> Result<(), RustConstructorError>

执行跳过渲染队列操作。

Source

pub fn update_render_layer(&mut self)

根据活跃资源更新渲染层级列表。

Source

pub fn display_render_layer( &self, ui: &mut Ui, render_config: &RenderConfig, ignore_render_config: &RenderConfig, )

绘制渲染层。

Source

pub fn get_render_layer_resource( &self, name: &str, discern_type: &str, ) -> Option<usize>

通过名称和类型在渲染列表中查找资源。

Source

pub fn resource_get_focus(&self, index: usize, mouse_pos: [f32; 2]) -> bool

检查资源是否获取鼠标焦点。

Source

pub fn add_active_resource( &mut self, name: &str, discern_type: &str, ) -> Result<(), RustConstructorError>

标记活跃资源。

Source

pub fn add_resource<T: RustConstructorResource + 'static>( &mut self, name: &str, resource: T, ) -> Result<(), RustConstructorError>

添加资源。

Source

pub fn drop_resource( &mut self, name: &str, discern_type: &str, ) -> Result<(), RustConstructorError>

移除资源。此方法非常危险!务必确保资源一定不再使用后删除。

Source

pub fn replace_resource<T>( &mut self, name: &str, resource: T, ) -> Result<(), RustConstructorError>
where T: RustConstructorResource + 'static,

从列表中替换资源。

Source

pub fn get_box_resource( &self, name: &str, discern_type: &str, ) -> Result<&dyn RustConstructorResource, RustConstructorError>

从列表中获取封装的不可变资源。

Source

pub fn get_box_resource_mut( &mut self, name: &str, discern_type: &str, ) -> Result<&mut dyn RustConstructorResource, RustConstructorError>

从列表中获取封装的可变资源。

Source

pub fn get_resource<T>( &self, name: &str, discern_type: &str, ) -> Result<&T, RustConstructorError>
where T: RustConstructorResource + 'static,

从列表中获取不可变资源。

Source

pub fn get_resource_mut<T>( &mut self, name: &str, discern_type: &str, ) -> Result<&mut T, RustConstructorError>
where T: RustConstructorResource + 'static,

从列表中获取可变资源。

Source

pub fn check_resource_exists( &self, name: &str, discern_type: &str, ) -> Option<usize>

检查是否存在特定资源。

Source

pub fn quick_place<T: RustConstructorResource + 'static>( &mut self, name: &str, resource: T, ui: &mut Ui, ctx: &Context, ) -> Result<(), RustConstructorError>

快速放置。

Source

pub fn use_resource( &mut self, name: &str, discern_type: &str, ui: &mut Ui, ctx: &Context, ) -> Result<(), RustConstructorError>

调用资源。

Source

pub fn switch_page(&mut self, name: &str) -> Result<(), RustConstructorError>

切换页面。

Source

pub fn get_font( &self, name: &str, ) -> Result<FontDefinitions, RustConstructorError>

输出字体资源。

Source

pub fn register_all_fonts(&self, ctx: &Context)

将所有已添加到RC的字体资源添加到egui中。

Source

pub fn position_size_processor( &self, position_size_config: PositionSizeConfig, ctx: &Context, ) -> [[f32; 2]; 2]

处理最基本的位置计算。

Source

pub fn check_updated( &mut self, name: &str, ) -> Result<bool, RustConstructorError>

检查页面是否已完成首次加载。

Source

pub fn check_enter_updated( &mut self, name: &str, ) -> Result<bool, RustConstructorError>

检查页面是否已完成加载。

Source

pub fn new_page_update( &mut self, name: &str, ) -> Result<(), RustConstructorError>

进入新页面时的更新。

Source

pub fn update_frame_stats(&mut self)

更新帧数。

Source

pub fn current_fps(&self) -> f32

更新帧数显示。

Source

pub fn reset_split_time( &mut self, name: &str, ) -> Result<(), RustConstructorError>

重置分段时间。

Source

pub fn get_split_time( &self, name: &str, ) -> Result<[f32; 2], RustConstructorError>

输出分段时间。

Source

pub fn update_timer(&mut self)

更新计时器。

Source

pub fn modify_variable<T: Debug + 'static>( &mut self, name: &str, value: Option<T>, ) -> Result<(), RustConstructorError>

修改变量资源。

Source

pub fn get_variable<T: Debug + Clone + 'static>( &self, name: &str, ) -> Result<Option<T>, RustConstructorError>

取出变量。

Source

pub fn get_image_texture( &self, name: &str, ) -> Result<Option<DebugTextureHandle>, RustConstructorError>

输出图片纹理。

Source

pub fn reset_image_texture( &mut self, name: &str, path: &str, flip: [bool; 2], ctx: &Context, ) -> Result<(), RustConstructorError>

重置图片纹理。

Source

pub fn set_switch_enable( &mut self, name: &str, enable: bool, ) -> Result<(), RustConstructorError>

修改开关的启用状态。

Source

pub fn check_switch_data( &self, name: &str, ) -> Result<SwitchData, RustConstructorError>

查找指定开关的常用判定字段集合。

Trait Implementations§

Source§

impl Debug for App

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for App

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for App

§

impl !RefUnwindSafe for App

§

impl !Send for App

§

impl !Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

§

impl !UnwindSafe for App

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more