Struct atoll::grid::RoutingGrid
source · pub struct RoutingGrid<L> {
pub stack: LayerStack<L>,
/* private fields */
}
Expand description
A fixed-size routing grid.
Does not store the state of track points in the grid.
For that functionality, see RoutingState
.
Fields§
§stack: LayerStack<L>
The layer stack.
Implementations§
source§impl<L> RoutingGrid<L>
impl<L> RoutingGrid<L>
sourcepub fn new(stack: LayerStack<L>, layers: Range<usize>) -> Self
pub fn new(stack: LayerStack<L>, layers: Range<usize>) -> Self
Creates a new routing grid with the given properties.
sourcepub fn slice(&self) -> LayerSlice<'_, L>
pub fn slice(&self) -> LayerSlice<'_, L>
The layer slice representing the layers used by this routing grid.
source§impl<L: AtollLayer> RoutingGrid<L>
impl<L: AtollLayer> RoutingGrid<L>
sourcepub fn track_span(&self, layer: usize, track: i64) -> Span
pub fn track_span(&self, layer: usize, track: i64) -> Span
Calculates the span of a particular track on the given layer.
sourcepub fn tracks(&self, layer: usize) -> UniformTracks
pub fn tracks(&self, layer: usize) -> UniformTracks
The tracks on the given layer.
sourcepub fn track_grid(&self, layer: usize) -> (UniformTracks, UniformTracks)
pub fn track_grid(&self, layer: usize) -> (UniformTracks, UniformTracks)
Returns the track grid for the given layer.
Returns a tuple containing the vertical going tracks followed by the horizontal going tracks. In other words, the first element of the tuple is indexed by an x-coordinate, and the second element of the tuple is indexed by a y-coordinate.
sourcepub fn track(&self, layer: usize, track: i64, start: i64, end: i64) -> Rect
pub fn track(&self, layer: usize, track: i64, start: i64, end: i64) -> Rect
Calculates the bounds of a particular track on the given layer.
The start and end coordinates are with respect to tracks on the grid defining layer.
sourcepub fn track_point(&self, layer: usize, track: i64, cross_track: i64) -> Point
pub fn track_point(&self, layer: usize, track: i64, cross_track: i64) -> Point
Returns the physical coordinates of the grid point defined by the given track
and cross_track
on layer layer
, where track
is the track on layer
and cross_track
is a perpendicular track.
sourcepub fn xy_track_point(&self, layer: usize, x_track: i64, y_track: i64) -> Point
pub fn xy_track_point(&self, layer: usize, x_track: i64, y_track: i64) -> Point
Returns the physical coordinates of the grid point defined by the given x_track
and y_track
on layer layer
.
sourcepub fn point_to_grid(
&self,
p: Point,
layer: usize,
round_x: RoundingMode,
round_y: RoundingMode
) -> Point
pub fn point_to_grid( &self, p: Point, layer: usize, round_x: RoundingMode, round_y: RoundingMode ) -> Point
Rounds the given point to the routing grid, returning a point in track coordinates on the given layer.
sourcepub fn shrink_to_grid(&self, rect: Rect, layer: usize) -> Option<Rect>
pub fn shrink_to_grid(&self, rect: Rect, layer: usize) -> Option<Rect>
Rounds the given point to the routing grid, returning a point in track coordinates on the given layer.
Rounds in the direction that makes the rectangle smaller.
If the resulting rectangle contains no track points, returns None
.
sourcepub fn expand_to_grid(&self, rect: Rect, layer: usize) -> Rect
pub fn expand_to_grid(&self, rect: Rect, layer: usize) -> Rect
Rounds the given point to the routing grid, returning a point in track coordinates on the given layer.
Rounds in the direction that makes the rectangle larger.
Trait Implementations§
source§impl<L: Clone> Clone for RoutingGrid<L>
impl<L: Clone> Clone for RoutingGrid<L>
source§fn clone(&self) -> RoutingGrid<L>
fn clone(&self) -> RoutingGrid<L>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<L: Debug> Debug for RoutingGrid<L>
impl<L: Debug> Debug for RoutingGrid<L>
source§impl<'de, L> Deserialize<'de> for RoutingGrid<L>where
L: Deserialize<'de>,
impl<'de, L> Deserialize<'de> for RoutingGrid<L>where
L: Deserialize<'de>,
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<L: Hash> Hash for RoutingGrid<L>
impl<L: Hash> Hash for RoutingGrid<L>
source§impl<L: PartialEq> PartialEq for RoutingGrid<L>
impl<L: PartialEq> PartialEq for RoutingGrid<L>
source§fn eq(&self, other: &RoutingGrid<L>) -> bool
fn eq(&self, other: &RoutingGrid<L>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<L> Serialize for RoutingGrid<L>where
L: Serialize,
impl<L> Serialize for RoutingGrid<L>where
L: Serialize,
impl<L: Eq> Eq for RoutingGrid<L>
impl<L> StructuralPartialEq for RoutingGrid<L>
Auto Trait Implementations§
impl<L> RefUnwindSafe for RoutingGrid<L>where
L: RefUnwindSafe,
impl<L> Send for RoutingGrid<L>where
L: Send,
impl<L> Sync for RoutingGrid<L>where
L: Sync,
impl<L> Unpin for RoutingGrid<L>where
L: Unpin,
impl<L> UnwindSafe for RoutingGrid<L>where
L: UnwindSafe,
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
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