[][src]Trait traitgraph::OptionalGraphIndex

pub trait OptionalGraphIndex<PartnerGraphIndex: GraphIndex<Self>>: Default + Debug + Eq + Ord + Copy + Sized + From<usize> + From<Option<usize>> + From<PartnerGraphIndex> + From<Option<PartnerGraphIndex>> + Into<Option<PartnerGraphIndex>> + Add<usize, Output = Self> {
    fn as_usize(self) -> Option<usize>;
fn as_usize_unchecked(self) -> usize; fn is_valid(self) -> bool { ... }
fn new_none() -> Self { ... } }

Required methods

fn as_usize(self) -> Option<usize>

Get this index as usize, but return None if this index is marked as invalid.

fn as_usize_unchecked(self) -> usize

A faster method to get the usize value of the index, which does not perform any validity checks.

Loading content...

Provided methods

fn is_valid(self) -> bool

Returns true if the index is valid, i.e. if it is not marked as invalid.

fn new_none() -> Self

Returns a new OptionalGraphIndex that is marked as invalid.

Loading content...

Implementors

impl<IndexType: PrimInt> OptionalGraphIndex<NodeIndex<IndexType>> for OptionalNodeIndex<IndexType>[src]

impl<IndexType: PrimInt> OptionalGraphIndex<EdgeIndex<IndexType>> for OptionalEdgeIndex<IndexType>[src]

Loading content...