#[non_exhaustive]pub enum VectorOperand {
Left,
Right,
}Expand description
Operand of a binary vector operation.
Identifies which input needs correction when LaError::ZeroVector or
NonFiniteLocation::VectorOperandEntry reports an invalid direction or
coordinate, including errors from crate::VectorAngle::angle.
§Examples
use la_stack::prelude::*;
match [1.0, 0.0].as_slice().angle(&[0.0, -0.0]) {
Err(LaError::ZeroVector { operand, .. }) => {
assert_eq!(operand, VectorOperand::Right);
}
_ => unreachable!("the right input is an all-zero vector"),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Trait Implementations§
Source§impl Clone for VectorOperand
impl Clone for VectorOperand
impl Copy for VectorOperand
Source§impl Debug for VectorOperand
impl Debug for VectorOperand
Source§impl Display for VectorOperand
impl Display for VectorOperand
impl Eq for VectorOperand
Source§impl PartialEq for VectorOperand
impl PartialEq for VectorOperand
impl StructuralPartialEq for VectorOperand
Auto Trait Implementations§
impl Freeze for VectorOperand
impl RefUnwindSafe for VectorOperand
impl Send for VectorOperand
impl Sync for VectorOperand
impl Unpin for VectorOperand
impl UnsafeUnpin for VectorOperand
impl UnwindSafe for VectorOperand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more