[−][src]Struct vector3d::Vector3d
A 3D vector.
Fields
x: T
The x component of the vector.
y: T
The y component of the vector.
z: T
The z component of the vector.
Methods
impl<T> Vector3d<T>
[src]
pub fn new(x: T, y: T, z: T) -> Vector3d<T>
[src]
Create a new Vector3d
.
pub fn dot<U: Mul<T, Output = X>, X: Add<Output = X>>(
self,
rhs: Vector3d<U>
) -> X
[src]
self,
rhs: Vector3d<U>
) -> X
The dot product of two vectors. Note that we assume that the vector components have commutative multiplication.
impl<T: Clone> Vector3d<T>
[src]
pub fn cross<U: Clone + Mul<T, Output = X>, X: Add<Output = X> + Sub<Output = X>>(
self,
rhs: Vector3d<U>
) -> Vector3d<X>
[src]
self,
rhs: Vector3d<U>
) -> Vector3d<X>
The cross product of two vectors. Note that we assume that the components of both vector types have commutative multiplication.
impl<T: Clone + Mul<T, Output = X>, X: Add<Output = X>> Vector3d<T>
[src]
Trait Implementations
impl<T: Clone> Clone for Vector3d<T>
[src]
impl<T: Default> Default for Vector3d<T>
[src]
impl<T: Copy> Copy for Vector3d<T>
[src]
impl<T: PartialEq> PartialEq<Vector3d<T>> for Vector3d<T>
[src]
impl<T: Debug> Debug for Vector3d<T>
[src]
impl<T: Display> Display for Vector3d<T>
[src]
impl<T: Sub<T, Output = T>> Sub<Vector3d<T>> for Vector3d<T>
[src]
type Output = Vector3d<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: Vector3d<T>) -> Self::Output
[src]
impl<S: Clone, X, T: Div<S, Output = X>> Div<S> for Vector3d<T>
[src]
type Output = Vector3d<X>
The resulting type after applying the /
operator.
fn div(self, rhs: S) -> Self::Output
[src]
impl<T: Add<T, Output = T>> Add<Vector3d<T>> for Vector3d<T>
[src]
type Output = Vector3d<T>
The resulting type after applying the +
operator.
fn add(self, rhs: Vector3d<T>) -> Self::Output
[src]
impl<S: Clone, X, T: Mul<S, Output = X>> Mul<S> for Vector3d<T>
[src]
type Output = Vector3d<X>
The resulting type after applying the *
operator.
fn mul(self, rhs: S) -> Self::Output
[src]
impl<T: Neg<Output = T>> Neg for Vector3d<T>
[src]
type Output = Vector3d<T>
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl<T> Index<usize> for Vector3d<T>
[src]
impl<T> IndexMut<usize> for Vector3d<T>
[src]
impl<T: Add<T, Output = T> + Sum<T>> Sum<Vector3d<T>> for Vector3d<T>
[src]
impl<'a, T: 'a + Add<T, Output = T> + Sum<T> + Clone> Sum<&'a Vector3d<T>> for Vector3d<T>
[src]
impl<T: ClapMe> ClapMe for Vector3d<T>
[src]
fn with_clap<ClapMeT>(
info: ArgInfo,
app: App,
f: impl FnOnce(App) -> ClapMeT
) -> ClapMeT
[src]
info: ArgInfo,
app: App,
f: impl FnOnce(App) -> ClapMeT
) -> ClapMeT
fn from_clap<'a, 'b>(_name: &str, _matches: &ArgMatches) -> Option<Self>
[src]
fn requires_flags(_name: &str) -> Vec<String>
[src]
fn help_message(cmdname: &str) -> String
[src]
fn from_args() -> Self
[src]
fn from_iter<I, T>(args: I) -> Result<Self, Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
[src]
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
impl<T> Serialize for Vector3d<T> where
T: Serialize,
[src]
T: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de, T> Deserialize<'de> for Vector3d<T> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl<T> Send for Vector3d<T> where
T: Send,
T: Send,
impl<T> Sync for Vector3d<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Vector3d<T> where
T: Unpin,
T: Unpin,
impl<T> RefUnwindSafe for Vector3d<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> UnwindSafe for Vector3d<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,