pub struct Ring { /* private fields */ }
Expand description
A rectangular ring surrounding an enclosed rectangle.
Implementations§
source§impl Ring
impl Ring
sourcepub fn builder() -> RingBuilder
pub fn builder() -> RingBuilder
Creates a new RingBuilder
.
sourcepub fn outer_hspan(&self) -> Span
pub fn outer_hspan(&self) -> Span
The horizontal span of the annulus of the ring.
sourcepub fn inner_hspan(&self) -> Span
pub fn inner_hspan(&self) -> Span
The horizontal span of the inner portion of the ring.
sourcepub fn outer_vspan(&self) -> Span
pub fn outer_vspan(&self) -> Span
The vertical span of the annulus of the ring.
sourcepub fn inner_vspan(&self) -> Span
pub fn inner_vspan(&self) -> Span
The vertical span of the inner portion of the ring.
sourcepub fn inner_rect(&self, side: Side) -> Rect
pub fn inner_rect(&self, side: Side) -> Rect
The annuluar rectangle on the given side, but limited to the width/height of the inner rectangle.
sourcepub fn corner(&self, corner: Corner) -> Rect
pub fn corner(&self, corner: Corner) -> Rect
The lower left annular corner.
Shares a corner with the inner rect, but does not have any edges in common with the inner rect.
sourcepub fn hrects(&self) -> [Rect; 2]
pub fn hrects(&self) -> [Rect; 2]
The Rect
s going in the horizontal direction (ie. the bottom and top rectangles).
sourcepub fn vrects(&self) -> [Rect; 2]
pub fn vrects(&self) -> [Rect; 2]
The Rect
s going in the vertical direction (ie. the left and right rectangles).
sourcepub fn inner_rects(&self) -> [Rect; 4]
pub fn inner_rects(&self) -> [Rect; 4]
The 4 inner annular rectangles.
The order is subject to change.
sourcepub fn inner_vrects(&self) -> [Rect; 2]
pub fn inner_vrects(&self) -> [Rect; 2]
The inner annular vertical-going (i.e. left and right) rectangles.
sourcepub fn inner_hrects(&self) -> [Rect; 2]
pub fn inner_hrects(&self) -> [Rect; 2]
The inner annular horizontal-going (i.e. top and bottom) rectangles.
sourcepub fn dir_rects(&self, dir: Dir) -> [Rect; 2]
pub fn dir_rects(&self, dir: Dir) -> [Rect; 2]
The Rect
s going in the given direction.
Also see Ring::hrects
and Ring::vrects
.
Trait Implementations§
source§impl Contains<Point> for Ring
impl Contains<Point> for Ring
source§fn contains(&self, other: &Point) -> Containment
fn contains(&self, other: &Point) -> Containment
source§fn partially_intersects(&self, other: &T) -> bool
fn partially_intersects(&self, other: &T) -> bool
other
is fully or partially enclosed in this shape.source§impl<'de> Deserialize<'de> for Ring
impl<'de> Deserialize<'de> for Ring
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>,
source§impl From<RingBuilder> for Ring
impl From<RingBuilder> for Ring
source§fn from(value: RingBuilder) -> Self
fn from(value: RingBuilder) -> Self
source§impl Ord for Ring
impl Ord for Ring
source§impl PartialEq for Ring
impl PartialEq for Ring
source§impl PartialOrd for Ring
impl PartialOrd for Ring
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TranslateMut for Ring
impl TranslateMut for Ring
source§fn translate_mut(&mut self, p: Point)
fn translate_mut(&mut self, p: Point)
Point
through mutation.