Struct libreda_pnr::db::Shapes[][src]

pub struct Shapes<T> where
    T: CoordinateType
{ /* fields omitted */ }

Shapes<T> is a collection of Shape<T> structs. Each of the elements is assigned an index when inserted into the collection.

Implementations

impl<T> Shapes<T> where
    T: CoordinateType
[src]

pub fn new_rc() -> Rc<Shapes<T>>[src]

Create a new shapes object. It is not associated with any cell.

pub fn from_geometries<I>(iter: I) -> Rc<Shapes<T>> where
    I: IntoIterator<Item = Geometry<T>>, 
[src]

Create a new Shapes object and populate it with the geometries from the iterator.

pub fn insert<I>(&self, shape: I) -> Rc<Shape<T>> where
    I: Into<Geometry<T>>, 
[src]

Add a shape to the collection.

pub fn remove_shape(&self, shape: &Shape<T>)[src]

Remove the shape from the collection if it exists. TODO: What if a shape from another Shapes collection is passed here?

pub fn len(&self) -> usize[src]

Return number of shapes in this container.

pub fn is_empty(&self) -> bool[src]

Tell if there are not shapes stored in this container.

pub fn each_shape(&self) -> impl Iterator<Item = Rc<Shape<T>>>[src]

Iterator over all shapes.

pub fn with_shape_iter<F, R>(&self, f: F) -> R where
    F: FnOnce(Values<'_, Index<Shape<T>>, Rc<Shape<T>>>) -> R, 
[src]

Iterate over all shapes.

pub fn for_each_shape<F>(&self, f: F) where
    F: FnMut(&Rc<Shape<T>>), 
[src]

Call a closure on each shape.

pub fn parent_cell(&self) -> Weak<Cell<T>>[src]

Get weak reference to the parent cell if there is any.

Trait Implementations

impl<T> Clone for Shapes<T> where
    T: Clone + CoordinateType
[src]

impl<T> Debug for Shapes<T> where
    T: Debug + CoordinateType
[src]

impl<T> Default for Shapes<T> where
    T: Default + CoordinateType
[src]

impl<T> TryBoundingBox<T> for Shapes<T> where
    T: CoordinateType
[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Shapes<T>

impl<T> !Send for Shapes<T>

impl<T> !Sync for Shapes<T>

impl<T> Unpin for Shapes<T> where
    T: Unpin

impl<T> !UnwindSafe for Shapes<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.