gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 707HTML 660Markdown 12TOML 62344 Definitions

⎇ c9a5913385a106460808a684f27b7efed7e5ae2f src/result.rs Rust · 27 lines · 560 B History Who touched what raw

Rebase & format c9a591338 · Emil Sjölander ·

1#[cfg(not(feature = "std"))]
2use alloc::vec::Vec;
3
4use core::any::Any;
5
6use crate::algo::ComputeResult;
7use crate::geometry::{Point, Size};
8use crate::number::Number;
9
10pub type Result<T> = core::result::Result<T, Box<Any>>;
11
12#[derive(Debug, Clone)]
13pub struct Layout {
14    pub(crate) order: u32,
15    pub size: Size<f32>,
16    pub location: Point<f32>,
17    pub children: Vec<Layout>,
18}
19
20#[derive(Debug, Clone)]
21pub struct Cache {
22    pub node_size: Size<Number>,
23    pub parent_size: Size<Number>,
24    pub perform_layout: bool,
25
26    pub result: ComputeResult,
27}