pub struct LayoutCacheKey {
pub area_x: u16,
pub area_y: u16,
pub area_width: u16,
pub area_height: u16,
pub constraints_hash: u64,
pub direction: Direction,
pub intrinsics_hash: Option<u64>,
}Expand description
Key for layout cache lookups.
Includes all parameters that affect layout computation:
- The available area (stored as components for Hash)
- A fingerprint of all constraints
- The layout direction
- Optionally, a fingerprint of intrinsic size hints
Fields§
§area_x: u16Area x-coordinate.
area_y: u16Area y-coordinate.
area_width: u16Area width.
area_height: u16Area height.
constraints_hash: u64Hash fingerprint of constraints.
direction: DirectionLayout direction.
intrinsics_hash: Option<u64>Hash fingerprint of intrinsic sizes (if using FitContent).
Implementations§
Source§impl LayoutCacheKey
impl LayoutCacheKey
Sourcepub fn new(
area: Rect,
constraints: &[Constraint],
direction: Direction,
intrinsics: Option<&[LayoutSizeHint]>,
) -> Self
pub fn new( area: Rect, constraints: &[Constraint], direction: Direction, intrinsics: Option<&[LayoutSizeHint]>, ) -> Self
Create a new cache key from layout parameters.
§Arguments
area- The available rectangle for layoutconstraints- The constraint listdirection- Horizontal or Vertical layoutintrinsics- Optional size hints for FitContent constraints
Trait Implementations§
Source§impl Clone for LayoutCacheKey
impl Clone for LayoutCacheKey
Source§fn clone(&self) -> LayoutCacheKey
fn clone(&self) -> LayoutCacheKey
Returns a duplicate 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 LayoutCacheKey
impl Debug for LayoutCacheKey
Source§impl Hash for LayoutCacheKey
impl Hash for LayoutCacheKey
Source§impl PartialEq for LayoutCacheKey
impl PartialEq for LayoutCacheKey
impl Copy for LayoutCacheKey
impl Eq for LayoutCacheKey
impl StructuralPartialEq for LayoutCacheKey
Auto Trait Implementations§
impl Freeze for LayoutCacheKey
impl RefUnwindSafe for LayoutCacheKey
impl Send for LayoutCacheKey
impl Sync for LayoutCacheKey
impl Unpin for LayoutCacheKey
impl UnwindSafe for LayoutCacheKey
Blanket Implementations§
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