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<Ring, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Ring, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl From<RingBuilder> for Ring
impl From<RingBuilder> for Ring
source§fn from(value: RingBuilder) -> Ring
fn from(value: RingBuilder) -> Ring
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 Serialize for Ring
impl Serialize for Ring
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
source§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.impl Copy for Ring
impl Eq for Ring
impl StructuralPartialEq for Ring
Auto Trait Implementations§
impl RefUnwindSafe for Ring
impl Send for Ring
impl Sync for Ring
impl Unpin for Ring
impl UnwindSafe for Ring
Blanket Implementations§
source§impl<T> AlignBbox for Twhere
T: AlignBboxMut,
impl<T> AlignBbox for Twhere
T: AlignBboxMut,
source§impl<T> AlignBboxMut for Twhere
T: AlignRectMut + Bbox,
impl<T> AlignBboxMut for Twhere
T: AlignRectMut + Bbox,
source§impl<T> AlignRect for Twhere
T: AlignRectMut,
impl<T> AlignRect for Twhere
T: AlignRectMut,
source§impl<T> AlignRectMut for Twhere
T: Translate,
impl<T> AlignRectMut for Twhere
T: Translate,
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<T, U> CustomHardwareType<Flipped<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
impl<T, U> CustomHardwareType<Flipped<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
source§fn from_layout_type(other: &Flipped<T>) -> U
fn from_layout_type(other: &Flipped<T>) -> U
source§impl<T, U> CustomHardwareType<InOut<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
impl<T, U> CustomHardwareType<InOut<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
source§fn from_layout_type(other: &InOut<T>) -> U
fn from_layout_type(other: &InOut<T>) -> U
source§impl<T, U> CustomHardwareType<Input<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
impl<T, U> CustomHardwareType<Input<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
source§fn from_layout_type(other: &Input<T>) -> U
fn from_layout_type(other: &Input<T>) -> U
source§impl<T, U> CustomHardwareType<Output<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
impl<T, U> CustomHardwareType<Output<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
source§fn from_layout_type(other: &Output<T>) -> U
fn from_layout_type(other: &Output<T>) -> U
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request