Struct zng_layout::context::LayoutMetricsSnapshot
source · pub struct LayoutMetricsSnapshot {
pub constraints: PxConstraints2d,
pub inline_constraints: Option<InlineConstraints>,
pub z_constraints: PxConstraints,
pub font_size: Px,
pub root_font_size: Px,
pub scale_factor: Factor,
pub viewport: PxSize,
pub screen_ppi: Ppi,
pub direction: LayoutDirection,
pub leftover: Size2D<Option<Px>, ()>,
}Expand description
Layout metrics snapshot.
A snapshot can be taken using the LayoutMetrics::snapshot.
Fields§
§constraints: PxConstraints2dThe constraints.
inline_constraints: Option<InlineConstraints>The inline_constraints.
z_constraints: PxConstraintsThe z_constraints.
font_size: PxThe font_size.
root_font_size: PxThe root_font_size.
scale_factor: FactorThe scale_factor.
viewport: PxSizeThe viewport.
screen_ppi: PpiThe screen_ppi.
direction: LayoutDirectionThe direction.
leftover: Size2D<Option<Px>, ()>The leftover.
Implementations§
source§impl LayoutMetricsSnapshot
impl LayoutMetricsSnapshot
sourcepub fn masked_eq(&self, other: &Self, mask: LayoutMask) -> bool
pub fn masked_eq(&self, other: &Self, mask: LayoutMask) -> bool
Gets if all of the fields in mask are equal between self and other.
Trait Implementations§
source§impl Clone for LayoutMetricsSnapshot
impl Clone for LayoutMetricsSnapshot
source§fn clone(&self) -> LayoutMetricsSnapshot
fn clone(&self) -> LayoutMetricsSnapshot
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for LayoutMetricsSnapshot
impl Debug for LayoutMetricsSnapshot
source§impl<'de> Deserialize<'de> for LayoutMetricsSnapshot
impl<'de> Deserialize<'de> for LayoutMetricsSnapshot
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for LayoutMetricsSnapshot
impl Hash for LayoutMetricsSnapshot
Auto Trait Implementations§
impl Freeze for LayoutMetricsSnapshot
impl RefUnwindSafe for LayoutMetricsSnapshot
impl Send for LayoutMetricsSnapshot
impl Sync for LayoutMetricsSnapshot
impl Unpin for LayoutMetricsSnapshot
impl UnwindSafe for LayoutMetricsSnapshot
Blanket Implementations§
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Access to mut
dyn Any methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
Clone the value.
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
Clone the value into a new boxed
LocalVar<Self>.source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more