Expand description
Trait for structs that represent a Vector, will be implemented by default when using the impl_vector Macro.
Returns the name of the Vector struct.
let vector = Vector4::new(0, 0, 0, 0);
assert_eq!(vector.name(), "Vector4");
Converts the given Vector into an array coresponding to the size of the Vector.
let vector = Vector3::new(1, 2, 3);
assert_eq!(vector.as_array(), [1, 2, 3]);
Converts the given Vector into a Vec coresponding to the size of the Vector.
let vector = Vector3::new(1, 2, 3);
assert_eq!(vector.as_vec(), vec![1, 2, 3]);
Returns the size of the Vector struct in bytes.
let vector = Vector2::<u16>::new(0, 0);
assert_eq!(vector.size(), 4);
Returns the number of fields in the Vector struct.
let vec2 = Vector2::new(0, 0);
let vec3 = Vector3::new(0, 0, 0);
let vec4 = Vector4::new(0, 0, 0, 0);
assert_eq!(vec2.len(), 2);
assert_eq!(vec3.len(), 3);
assert_eq!(vec4.len(), 4);