Struct libreda_pnr::db::Shapes [−][src]
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]
T: CoordinateType,
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]
I: IntoIterator<Item = Geometry<T>>,
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]
I: Into<Geometry<T>>,
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]
F: FnOnce(Values<'_, Index<Shape<T>>, Rc<Shape<T>>>) -> R,
Iterate over all shapes.
pub fn for_each_shape<F>(&self, f: F) where
F: FnMut(&Rc<Shape<T>>),
[src]
F: FnMut(&Rc<Shape<T>>),
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]
T: Clone + CoordinateType,
impl<T> Debug for Shapes<T> where
T: Debug + CoordinateType,
[src]
T: Debug + CoordinateType,
impl<T> Default for Shapes<T> where
T: Default + CoordinateType,
[src]
T: Default + CoordinateType,
impl<T> TryBoundingBox<T> for Shapes<T> where
T: CoordinateType,
[src]
T: CoordinateType,
pub fn try_bounding_box(&self) -> Option<Rect<T>>
[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,
T: Unpin,
impl<T> !UnwindSafe for Shapes<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,