Skip to main content

MergeObj

Struct MergeObj 

Source
pub struct MergeObj<T1, T2> { /* private fields */ }
Expand description

Represents a merge object that encapsulates a point with coordinates of type T1 and T2.

The MergeObj struct is used for geometric operations such as distance calculation, enlargement, intersection, and merging with other merge objects.

§Examples

use physdes::merge_obj::MergeObj;

let merge_obj = MergeObj::new(3, 4);
let internal_point = merge_obj.get_impl();
assert_eq!(internal_point.xcoord, 3);
assert_eq!(internal_point.ycoord, 4);

Implementations§

Source§

impl<T1, T2> MergeObj<T1, T2>

Source

pub const fn new(xcoord: T1, ycoord: T2) -> MergeObj<T1, T2>

Source

pub const fn construct(xcoord: i32, ycoord: i32) -> MergeObj<i32, i32>

Source

pub fn get_impl(&self) -> &Point<T1, T2>

Returns a reference to the internal Point of the MergeObj

§Examples
use physdes::merge_obj::MergeObj;

let merge_obj = MergeObj::new(3, 4);
let internal_point = merge_obj.get_impl();
assert_eq!(internal_point.xcoord, 3);
assert_eq!(internal_point.ycoord, 4);
Source§

impl<T1, T2> MergeObj<T1, T2>
where T1: MinDist<T1>, T2: MinDist<T2>,

Source

pub fn min_dist_with(&self, other: &MergeObj<T1, T2>) -> u32

Source§

impl<T1, T2> MergeObj<T1, T2>
where T1: MinDist<T1> + Enlarge<i32, Output = T1> + Intersect<T1, Output = T1>, T2: MinDist<T2> + Enlarge<i32, Output = T2> + Intersect<T2, Output = T2>,

Source

pub fn enlarge_with(&self, alpha: i32) -> MergeObj<T1, T2>

Source

pub fn intersect_with(&self, other: &MergeObj<T1, T2>) -> MergeObj<T1, T2>

Source

pub fn merge_with(&self, other: &MergeObj<T1, T2>) -> MergeObj<T1, T2>

Trait Implementations§

Source§

impl<T1: Clone, T2: Clone> Clone for MergeObj<T1, T2>

Source§

fn clone(&self) -> MergeObj<T1, T2>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T1: Debug, T2: Debug> Debug for MergeObj<T1, T2>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T1: Default, T2: Default> Default for MergeObj<T1, T2>

Source§

fn default() -> MergeObj<T1, T2>

Returns the “default value” for a type. Read more
Source§

impl<T1: Hash, T2: Hash> Hash for MergeObj<T1, T2>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T1: PartialEq, T2: PartialEq> PartialEq for MergeObj<T1, T2>

Source§

fn eq(&self, other: &MergeObj<T1, T2>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T1: Copy, T2: Copy> Copy for MergeObj<T1, T2>

Source§

impl<T1: Eq, T2: Eq> Eq for MergeObj<T1, T2>

Source§

impl<T1, T2> StructuralPartialEq for MergeObj<T1, T2>

Auto Trait Implementations§

§

impl<T1, T2> Freeze for MergeObj<T1, T2>
where T1: Freeze, T2: Freeze,

§

impl<T1, T2> RefUnwindSafe for MergeObj<T1, T2>

§

impl<T1, T2> Send for MergeObj<T1, T2>
where T1: Send, T2: Send,

§

impl<T1, T2> Sync for MergeObj<T1, T2>
where T1: Sync, T2: Sync,

§

impl<T1, T2> Unpin for MergeObj<T1, T2>
where T1: Unpin, T2: Unpin,

§

impl<T1, T2> UnsafeUnpin for MergeObj<T1, T2>
where T1: UnsafeUnpin, T2: UnsafeUnpin,

§

impl<T1, T2> UnwindSafe for MergeObj<T1, T2>
where T1: UnwindSafe, T2: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.