#[non_exhaustive]pub struct Region {
pub key: u64,
pub anchor: Anchor,
pub side: Side,
pub gap: f32,
pub priority: i32,
pub flow: Axis,
pub depth: Option<f32>,
}Expand description
A named place for cards on a surface.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.key: u64The caller’s key, which cards name (Card::region).
anchor: AnchorWhere it sits.
side: SideOver the surface or around it.
gap: f32In points: from the surface’s edges to the cards, between cards, and between this region’s cards and another region’s.
priority: i32Regions with a higher priority take their room first.
flow: AxisThe way its cards flow: across in rows (Width) or down in
columns (Height), wrapping to a new row or column when one is
full.
depth: Option<f32>In points, how far the region reaches into the surface across its
flow (a row band’s height, a column band’s width); None reaches
as far as the room allows.
Implementations§
Source§impl Region
impl Region
Sourcepub fn new(key: u64, anchor: Anchor) -> Region
pub fn new(key: u64, anchor: Anchor) -> Region
A region over the surface at anchor, with no gap, priority 0, its
anchor’s default flow and no depth limit.
Sourcepub fn with_priority(self, priority: i32) -> Region
pub fn with_priority(self, priority: i32) -> Region
The same region with a priority.
Sourcepub fn with_depth(self, depth: f32) -> Region
pub fn with_depth(self, depth: f32) -> Region
The same region reaching at most depth points across its flow.