pub struct SlotDto {
pub slot: &'static str,
pub available: bool,
pub free_rect: Option<PixelRectDto>,
pub free_width: u32,
pub free_height: u32,
pub occupied_fraction: f32,
pub connected_neighbours: Vec<&'static str>,
}Expand description
One of the nine candidate placement slots and how much free space it has.
Fields§
§slot: &'static strthe slot name (top_left, top_center, …, center, …,
bottom_right).
available: boolwhether the slot itself is free of overlay content.
free_rect: Option<PixelRectDto>the largest empty rectangle that can be placed anchored here, confined to
this slot’s own third of the map so the nine slots never overlap, or
null when the slot’s third has no free space at the anchor.
free_width: u32width of Self::free_rect in pixels (0 when covered).
free_height: u32height of Self::free_rect in pixels (0 when covered).
occupied_fraction: f32fraction (0.0..=1.0) of the local third-of-the-map region around the
anchor that is covered, as a density hint.
connected_neighbours: Vec<&'static str>orthogonally adjacent anchors that share one contiguous free area with this anchor, so they can be combined for a larger element.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SlotDto
impl RefUnwindSafe for SlotDto
impl Send for SlotDto
impl Sync for SlotDto
impl Unpin for SlotDto
impl UnsafeUnpin for SlotDto
impl UnwindSafe for SlotDto
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.