Trait Hull

Source
pub trait Hull<T: ?Sized> {
    type Output;

    // Required method
    fn hull_with(&self, other: &T) -> Self::Output;
}
Expand description

The above code is defining a trait named Hull in Rust. This trait has a generic type T that must be sized. It also has an associated type Output. The trait has a method hull_with that takes a reference to another object of type T and returns an object of type Output. This trait can be implemented for different types to provide the hull_with functionality.

Required Associated Types§

Required Methods§

Source

fn hull_with(&self, other: &T) -> Self::Output

Implementations on Foreign Types§

Source§

impl Hull<i32> for i32

Source§

fn hull_with(&self, other: &i32) -> Self::Output

The function hull_with calculates the lower and upper bounds between two values.

Arguments:

  • other: The other parameter in the hull_with function is a reference to an i32 type. This parameter is used to calculate the lower bound (lb) and upper bound (ub) values for the output struct.
Source§

type Output = Interval<i32>

Implementors§

Source§

impl<T1, T2> Hull<Point<T1, T2>> for Point<T1, T2>
where T1: Hull<T1>, T2: Hull<T2>,

The above code is implementing a trait called Hull for the Point struct in Rust. The Hull trait defines a method hull_with that calculates the hull (convex hull, for example) of two points. The implementation specifies that the output type of the hull operation on two Point instances is a new Point with the hull operation applied to the x and y coordinates of the points. The implementation also specifies that the hull operation is applied to the generic types T1 and T2 where T1 and `T

Source§

type Output = Point<<T1 as Hull<T1>>::Output, <T2 as Hull<T2>>::Output>

Source§

impl<T> Hull<Interval<T>> for Interval<T>
where T: Copy + Ord,

Source§

impl<T> Hull<Interval<T>> for T
where T: Copy + Ord,

Source§

impl<T> Hull<T> for Interval<T>
where T: Copy + Ord,