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§
Implementations on Foreign Types§
Source§impl Hull<i32> for i32
impl Hull<i32> for i32
Source§fn hull_with(&self, other: &i32) -> Self::Output
fn hull_with(&self, other: &i32) -> Self::Output
The function hull_with calculates the lower and upper bounds between two values.
Arguments:
other: Theotherparameter in thehull_withfunction is a reference to ani32type. This parameter is used to calculate the lower bound (lb) and upper bound (ub) values for the output struct.
type Output = Interval<i32>
Implementors§
Source§impl<T1, T2> Hull<Point<T1, T2>> for Point<T1, 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
impl<T1, T2> Hull<Point<T1, T2>> for Point<T1, 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