pub struct Block {
pub top_left: Point,
pub bottom_right: Point,
}Fields§
§top_left: Point§bottom_right: PointImplementations§
Source§impl Block
impl Block
pub fn expand_x(&self, delta_x: impl Into<CoordX>) -> Self
pub fn expand_y(&self, delta_y: impl Into<CoordY>) -> Self
pub fn spans_y(&self, y: CoordY) -> bool
pub fn spans_x(&self, x: CoordX) -> bool
pub fn is_left_of(&self, x: CoordX) -> bool
pub fn is_right_of(&self, x: CoordX) -> bool
pub fn is_above(&self, y: CoordY) -> bool
pub fn is_below(&self, y: CoordY) -> bool
pub fn contains(&self, point: Point) -> bool
pub fn intersects_edge( &self, start_point: impl Into<Point>, end_point: impl Into<Point>, ) -> bool
Sourcepub fn edge_crossing(
&self,
a: impl Into<Point>,
b: impl Into<Point>,
) -> Option<(Point, Point)>
pub fn edge_crossing( &self, a: impl Into<Point>, b: impl Into<Point>, ) -> Option<(Point, Point)>
The part of the straight wire a → b that runs through this block, or
None when it passes clear — what Self::intersects_edge refuses.
Along the wire the overlap must have length, so a wire ending on an edge
is clear; across it the edges count, so a wire running along one is not.
Sourcepub fn hugs_wire(
&self,
a: impl Into<Point>,
b: impl Into<Point>,
gutter: i32,
) -> bool
pub fn hugs_wire( &self, a: impl Into<Point>, b: impl Into<Point>, gutter: i32, ) -> bool
The straight wire a → b runs alongside one of this block’s edges within
gutter cells — parallel to the edge and overlapping its span — rather than
merely leaving a pin perpendicular to it (a stub touches the gutter only at
its anchored endpoint). Such a wire hugs the block and should route around.
Trait Implementations§
impl Copy for Block
impl Eq for Block
impl StructuralPartialEq for Block
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnsafeUnpin for Block
impl UnwindSafe for Block
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
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
Checks if this value is equivalent to the given key. Read more