Trait metfor::VectorQuantity
source · pub trait VectorQuantity: Copy + Debug + Display + Sized {
fn pack_xy(_: (f64, f64)) -> Self;
fn unpack_xy(self) -> (f64, f64);
fn unwrap_xy(self) -> (f64, f64);
fn into_option(self) -> Option<(f64, f64)>;
}
Expand description
A version of Quantity
for vectors.
Required Methods
sourcefn pack_xy(_: (f64, f64)) -> Self
fn pack_xy(_: (f64, f64)) -> Self
Create a new instance of self by wrapping some values. This must be x-y coordinates from the standard cartesian coordinate system.
sourcefn unpack_xy(self) -> (f64, f64)
fn unpack_xy(self) -> (f64, f64)
Unpack a wrapped value without any error checking. The returned values represent the vector in a standard x-y cartesian coordinate system.
sourcefn unwrap_xy(self) -> (f64, f64)
fn unwrap_xy(self) -> (f64, f64)
Unwrap the values from the new type and check validity, panic if contents are invalid. The returned values represent the vector in a standard x-y cartesian coordinate system.
sourcefn into_option(self) -> Option<(f64, f64)>
fn into_option(self) -> Option<(f64, f64)>
Convert into an option that is None
if the content is invalid. The returned values
represent the vector in a standard x-y cartesian coordinate system.