Alignable

Trait Alignable 

Source
pub trait Alignable: Clone {
    // Required methods
    fn is_aligned(&self, other: &Self) -> bool;
    fn align_with(&mut self, other: &mut Self);
}
Expand description

A trait for aligning two items

Alignment is actually the meaning of preparation for interpolation.

For example, if we want to interpolate two VItems, we need to align all their inner components like ComponentVec<VPoint> to the same length.

Required Methods§

Source

fn is_aligned(&self, other: &Self) -> bool

Checking if two items are aligned

Source

fn align_with(&mut self, other: &mut Self)

Aligning two items

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Alignable for MeshItem

Source§

fn is_aligned(&self, other: &MeshItem) -> bool

Source§

fn align_with(&mut self, other: &mut MeshItem)

Source§

impl Alignable for Polygon

Source§

fn is_aligned(&self, other: &Polygon) -> bool

Source§

fn align_with(&mut self, other: &mut Polygon)

Source§

impl Alignable for Rectangle

Source§

fn align_with(&mut self, _other: &mut Rectangle)

Source§

fn is_aligned(&self, _other: &Rectangle) -> bool

Source§

impl Alignable for RegularPolygon

Source§

fn is_aligned(&self, _other: &RegularPolygon) -> bool

Source§

fn align_with(&mut self, _other: &mut RegularPolygon)

Source§

impl Alignable for Square

Source§

fn is_aligned(&self, _other: &Square) -> bool

Source§

fn align_with(&mut self, _other: &mut Square)

Source§

impl Alignable for VItem

Source§

fn is_aligned(&self, other: &VItem) -> bool

Source§

fn align_with(&mut self, other: &mut VItem)

Source§

impl Alignable for TypstText

Source§

fn is_aligned(&self, other: &TypstText) -> bool

Source§

fn align_with(&mut self, other: &mut TypstText)

Source§

impl Alignable for DVec3

Source§

fn align_with(&mut self, _other: &mut DVec3)

Source§

fn is_aligned(&self, _other: &DVec3) -> bool

Source§

impl<T> Alignable for Vec<T>
where T: Opacity + Alignable + Clone,

Source§

fn is_aligned(&self, other: &Vec<T>) -> bool

Source§

fn align_with(&mut self, other: &mut Vec<T>)

Implementors§