#[non_exhaustive]pub struct Card {
pub region: u64,
pub element: Element,
pub priority: i32,
pub size: Option<[f32; 2]>,
}Expand description
A card: one element of the slot engine, placed in a region.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.region: u64The region’s key.
element: ElementThe element: its key (unique across the cards), forms, orientations, and its pin, counted from the region’s anchor corner.
priority: i32When room runs out, cards with a lower priority fold first.
size: Option<[f32; 2]>A size in points, [width, height], instead of the element’s
forms: the card takes the smallest slot holding it and the gap,
and its rectangle is this size, against the anchor in its slot.
Implementations§
Source§impl Card
impl Card
Sourcepub fn new(region: u64, element: Element) -> Card
pub fn new(region: u64, element: Element) -> Card
A card for element in the region keyed region, priority 0.
Sourcepub fn sized(key: u64, region: u64, width: f32, height: f32) -> Card
pub fn sized(key: u64, region: u64, width: f32, height: f32) -> Card
A card width by height points.
Sourcepub fn with_priority(self, priority: i32) -> Card
pub fn with_priority(self, priority: i32) -> Card
The same card with a priority.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Card
impl<'de> Deserialize<'de> for Card
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
impl StructuralPartialEq for Card
Auto Trait Implementations§
impl Freeze for Card
impl RefUnwindSafe for Card
impl Send for Card
impl Sync for Card
impl Unpin for Card
impl UnsafeUnpin for Card
impl UnwindSafe for Card
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