fn try_from(value: GridVector) -> Result<Self, Self::Error> {
        use Face::*;
        match value {
            GridVector { x: 0, y: 0, z: 0 } => Ok(Within),
            GridVector { x: 1, y: 0, z: 0 } => Ok(PX),
            GridVector { x: 0, y: 1, z: 0 } => Ok(PY),
            GridVector { x: 0, y: 0, z: 1 } => Ok(PZ),
            GridVector { x: -1, y: 0, z: 0 } => Ok(NX),
            GridVector { x: 0, y: -1, z: 0 } => Ok(NY),
            GridVector { x: 0, y: 0, z: -1 } => Ok(NZ),
            not_unit_vector => Err(not_unit_vector),
        }
    }
/// Recovers a `Face` from its corresponding unit normal vector. All other vectors
/// are rejected.
///
/// ```
/// use all_is_cubes::math::{Face, GridVector};
/// use std::convert::TryFrom;
///
/// // A Face may be converted from its normal vector.
/// for &face in Face::ALL_SEVEN {
///     assert_eq!(Face::try_from(face.normal_vector()), Ok(face));
/// }
///
/// // If the vector does not correspond to any Face, it is returned.
/// let v = GridVector::new(1, 2, 3);
/// assert_eq!(Face::try_from(v), Err(v));
/// ```
Recovers a `Face` from its corresponding unit normal vector. All other vectors
are rejected.



A Face may be converted from its normal vector.

If the vector does not correspond to any Face, it is returned.
Recovers a ` Face ` from its corresponding unit normal vector . All other vectors are rejected . A Face may be converted from its normal vector . If the vector does not correspond to any Face it is returned .
fn try_from(value: GridVector) -> Result<Self, Self::Error> {
        use Face::*;
        match value {
            GridVector { x: 0, y: 0, z: 0 } => Ok(Within),
            GridVector { x: 1, y: 0, z: 0 } => Ok(PX),
            GridVector { x: 0, y: 1, z: 0 } => Ok(PY),
            GridVector { x: 0, y: 0, z: 1 } => Ok(PZ),
            GridVector { x: -1, y: 0, z: 0 } => Ok(NX),
            GridVector { x: 0, y: -1, z: 0 } => Ok(NY),
            GridVector { x: 0, y: 0, z: -1 } => Ok(NZ),
            not_unit_vector => Err(not_unit_vector),
        }
    }
fn try_from ( value : GridVector ) -> Result < Self , Self :: Error > { use Face :: * ; match value { GridVector { x : 0 , y : 0 , z : 0 } => Ok ( Within ) , GridVector { x : 1 , y : 0 , z : 0 } => Ok ( PX ) , GridVector { x : 0 , y : 1 , z : 0 } => Ok ( PY ) , GridVector { x : 0 , y : 0 , z : 1 } => Ok ( PZ ) , GridVector { x : - 1 , y : 0 , z : 0 } => Ok ( NX ) , GridVector { x : 0 , y : - 1 , z : 0 } => Ok ( NY ) , GridVector { x : 0 , y : 0 , z : - 1 } => Ok ( NZ ) , not_unit_vector => Err ( not_unit_vector ) , } }
Recovers a `Face` from its corresponding unit normal vector.
Recovers a ` Face ` from its corresponding unit normal vector .
value
GridVector