Skip to main content

ElementDetail

Struct ElementDetail 

Source
pub struct ElementDetail {
Show 13 fields pub id: ElementId, pub parent: Option<ElementId>, pub depth: usize, pub type_name: &'static str, pub bounds: Rect, pub parent_bounds: Option<Rect>, pub constraints: Option<BoxConstraints>, pub layout_size: Option<Size>, pub dirty: bool, pub stateful: bool, pub animating: bool, pub focusable: bool, pub focused: bool,
}
Expand description

拾取/布局 overlay 用的单元素只读详情(一次取齐 Inspector 需要的信息)。

与 ElementInfo 的区别:后者是「整棵树的行」,不含几何;本类型是「一个元素」, 含 bounds 与上一次 layout 的约束,供元素拾取与布局 overlay 使用。

Fields§

§id: ElementId§parent: Option<ElementId>§depth: usize

相对根的深度(根 = 0)

§type_name: &'static str§bounds: Rect

root layer 逻辑坐标下的占据区域。

优先用 RO 的 content_size();容器 RO 返回零尺寸时退回到 layout 结果尺寸, 这样拾取高亮不会显示成 0×0。

§parent_bounds: Option<Rect>

父元素占据区域,用于观察 margin/溢出;根元素为 None

§constraints: Option<BoxConstraints>

上一次 layout 收到的约束(从未布局过为 None)

§layout_size: Option<Size>

上一次 layout 返回的尺寸(从未布局过为 None)

§dirty: bool§stateful: bool§animating: bool§focusable: bool§focused: bool

Trait Implementations§

Source§

impl Clone for ElementDetail

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ElementDetail

Source§

impl Debug for ElementDetail

Source§

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

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

impl PartialEq for ElementDetail

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ElementDetail

Auto Trait Implementations§

§

impl Forget for ElementDetail

§

impl Freeze for ElementDetail
where NonZero<u32>: Freeze, &'static str: Freeze,

§

impl Move for ElementDetail

§

impl RefUnwindSafe for ElementDetail

§

impl Send for ElementDetail
where NonZero<u32>: Send, &'static str: Send,

§

impl Sync for ElementDetail
where NonZero<u32>: Sync,

§

impl Unpin for ElementDetail
where NonZero<u32>: Unpin, &'static str: Unpin,

§

impl UnsafeUnpin for ElementDetail
where NonZeroU32Inner: UnsafeUnpin, &'static str: UnsafeUnpin,

§

impl UnwindSafe for ElementDetail
where NonZero<u32>: UnwindSafe, &'static str: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.