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: PxConstraints2d
The constraints
.
inline_constraints: Option<InlineConstraints>
The inline_constraints
.
z_constraints: PxConstraints
The z_constraints
.
font_size: Px
The font_size
.
root_font_size: Px
The root_font_size
.
scale_factor: Factor
The scale_factor
.
viewport: PxSize
The viewport
.
screen_ppi: Ppi
The screen_ppi
.
direction: LayoutDirection
The 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
source§impl PartialEq for LayoutMetricsSnapshot
impl PartialEq 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§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self
equals other
.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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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