Struct libreda_db::layout::shape_collection::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: CoordinateType> Shapes<T>[src]
pub fn new_rc() -> Rc<Self>[src]
Create a new shapes object. It is not associated with any cell.
pub fn from_geometries<I: IntoIterator<Item = Geometry<T>>>(iter: I) -> Rc<Self>[src]
Create a new Shapes object and populate it with the geometries from the iterator.
pub fn insert<I: Into<Geometry<T>>>(&self, shape: I) -> Rc<Shape<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]
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> Clone for Shapes<T> where
T: CoordinateType, [src]
T: CoordinateType,
impl<T: Debug> Debug for Shapes<T> where
T: CoordinateType, [src]
T: CoordinateType,
impl<T: Default> Default for Shapes<T> where
T: CoordinateType, [src]
T: CoordinateType,
impl<T: CoordinateType> TryBoundingBox<T> for Shapes<T>[src]
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>,