AxisDirection

Trait AxisDirection 

Source
pub trait AxisDirection: Clone {
    // Required methods
    fn is_forward(&self) -> bool;
    fn dir_to_index(&self) -> usize;
    unsafe fn dir_from_index_unchecked(index: usize) -> Self;
    fn dir_from_index(index: usize) -> Option<Self>
       where Self: Sized;

    // Provided method
    fn is_backward(&self) -> bool { ... }
}
Expand description

Direction of axis. It tells which direction is connected to node.

Required Methods§

Source

fn is_forward(&self) -> bool

👎Deprecated: Use Axis::is_forward_direction instead.

Check this match whith Axis. It will always return true when Axis is directed.

Source

fn dir_to_index(&self) -> usize

Convert to index.

Source

unsafe fn dir_from_index_unchecked(index: usize) -> Self

Convert from index.

Source

fn dir_from_index(index: usize) -> Option<Self>
where Self: Sized,

Convert from index.

Provided Methods§

Source

fn is_backward(&self) -> bool

👎Deprecated: Use !Axis::is_forward_direction instead.

Check this doesn’t match whith Axis. It will always return false when Axis is directed.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<A> AxisDirection for A
where A: Axis<Direction = Self>,

Implimention for Axis of directed graph.

Source§

impl<T: Axis> AxisDirection for Direction<T>