Struct gut::index::Index[][src]

#[repr(transparent)]pub struct Index(_);

A possibly invalid unsigned index. The maximum usize integer represents an invalid index. This index type is ideal for storage. Overflow is not handled by this type. Instead we rely on Rust's internal overflow panics during debug builds.

Implementations

impl Index[src]

pub const INVALID: Index[src]

Invalid index instance.

pub fn new(i: usize) -> Index[src]

Create a valid index from a usize type. This constructor does the necessary check for debug builds only.

pub fn into_option(self) -> Option<usize>[src]

Convert this Index into Option<usize>, which is a larger struct.

pub fn map_inner<F: FnOnce(usize) -> usize>(self, f: F) -> Index[src]

Manipulate the inner representation of the index. This method avoids the additional check used in map. Use this to opt out of automatic index checking.

pub fn and_then<F: FnOnce(usize) -> Index>(self, f: F) -> Index[src]

Checked and_then over inner index. This allows operations on valid indices only.

pub fn apply<F: FnOnce(&mut usize)>(&mut self, f: F)[src]

Apply a function to the inner usize index. The index remains unchanged if invalid.

pub fn if_valid<F: FnOnce(usize)>(self, f: F)[src]

Apply a function to the inner usize index.

pub fn into_inner(self) -> usize[src]

Get the raw usize representation of this Index. This may be useful for performance critical code or debugging.

Trait Implementations

impl Add<Index> for Index[src]

type Output = Index

The resulting type after applying the + operator.

impl Add<usize> for Index[src]

type Output = Index

The resulting type after applying the + operator.

impl AddAssign<usize> for Index[src]

impl CheckedIndex<usize> for Index[src]

impl Clone for Index[src]

impl Copy for Index[src]

impl Debug for Index[src]

impl Default for Index[src]

impl Display for Index[src]

impl Div<usize> for Index[src]

type Output = Index

The resulting type after applying the / operator.

impl Eq for Index[src]

impl From<CellEdgeIndex> for Index[src]

impl From<CellFaceIndex> for Index[src]

impl From<CellIndex> for Index[src]

impl From<CellVertexIndex> for Index[src]

impl From<EdgeCellIndex> for Index[src]

impl From<EdgeFaceIndex> for Index[src]

impl From<EdgeIndex> for Index[src]

impl From<EdgeVertexIndex> for Index[src]

impl From<FaceCellIndex> for Index[src]

impl From<FaceEdgeIndex> for Index[src]

impl From<FaceIndex> for Index[src]

impl From<FaceVertexIndex> for Index[src]

impl From<Index> for MeshIndex[src]

impl From<Index> for VertexIndex[src]

impl From<Index> for CellFaceIndex[src]

impl From<Index> for VertexEdgeIndex[src]

impl From<Index> for VertexFaceIndex[src]

impl From<Index> for VertexCellIndex[src]

impl From<Index> for EdgeFaceIndex[src]

impl From<Index> for EdgeCellIndex[src]

impl From<Index> for FaceCellIndex[src]

impl From<Index> for EdgeIndex[src]

impl From<Index> for FaceIndex[src]

impl From<Index> for CellIndex[src]

impl From<Index> for EdgeVertexIndex[src]

impl From<Index> for FaceVertexIndex[src]

impl From<Index> for FaceEdgeIndex[src]

impl From<Index> for CellVertexIndex[src]

impl From<Index> for CellEdgeIndex[src]

impl From<MeshIndex> for Index[src]

impl From<Option<CellEdgeIndex>> for Index[src]

impl From<Option<CellFaceIndex>> for Index[src]

impl From<Option<CellIndex>> for Index[src]

impl From<Option<CellVertexIndex>> for Index[src]

impl From<Option<EdgeCellIndex>> for Index[src]

impl From<Option<EdgeFaceIndex>> for Index[src]

impl From<Option<EdgeIndex>> for Index[src]

impl From<Option<EdgeVertexIndex>> for Index[src]

impl From<Option<FaceCellIndex>> for Index[src]

impl From<Option<FaceEdgeIndex>> for Index[src]

impl From<Option<FaceIndex>> for Index[src]

impl From<Option<FaceVertexIndex>> for Index[src]

impl From<Option<MeshIndex>> for Index[src]

impl From<Option<VertexCellIndex>> for Index[src]

impl From<Option<VertexEdgeIndex>> for Index[src]

impl From<Option<VertexFaceIndex>> for Index[src]

impl From<Option<VertexIndex>> for Index[src]

impl From<Option<usize>> for Index[src]

impl From<VertexCellIndex> for Index[src]

impl From<VertexEdgeIndex> for Index[src]

impl From<VertexFaceIndex> for Index[src]

impl From<VertexIndex> for Index[src]

impl From<i16> for Index[src]

Create an index from a signed integer type. If the given argument is negative, the created index will be invalid.

impl From<i32> for Index[src]

Create an index from a signed integer type. If the given argument is negative, the created index will be invalid.

impl From<i64> for Index[src]

Create an index from a signed integer type. If the given argument is negative, the created index will be invalid.

impl From<i8> for Index[src]

Create an index from a signed integer type. If the given argument is negative, the created index will be invalid.

impl From<isize> for Index[src]

Create an index from a signed integer type. If the given argument is negative, the created index will be invalid.

impl From<u16> for Index[src]

Create a valid index from a usize type. This converter does the necessary bounds check for debug builds only.

impl From<u32> for Index[src]

Create a valid index from a usize type. This converter does the necessary bounds check for debug builds only.

impl From<u64> for Index[src]

Create a valid index from a usize type. This converter does the necessary bounds check for debug builds only.

impl From<u8> for Index[src]

Create a valid index from a usize type. This converter does the necessary bounds check for debug builds only.

impl From<usize> for Index[src]

Create a valid index from a usize type. This converter does the necessary bounds check for debug builds only.

impl Hash for Index[src]

impl Into<Option<usize>> for Index[src]

impl IntoIterator for Index[src]

type Item = usize

The type of the elements being iterated over.

type IntoIter = IntoIter<usize>

Which kind of iterator are we turning this into?

impl Mul<usize> for Index[src]

type Output = Index

The resulting type after applying the * operator.

impl Ord for Index[src]

impl PartialEq<Index> for Index[src]

impl PartialEq<usize> for Index[src]

impl PartialOrd<Index> for Index[src]

impl PartialOrd<usize> for Index[src]

impl Pod for Index[src]

impl Rem<usize> for Index[src]

type Output = Index

The resulting type after applying the % operator.

impl StructuralEq for Index[src]

impl StructuralPartialEq for Index[src]

impl Sub<Index> for Index[src]

type Output = Index

The resulting type after applying the - operator.

impl Sub<usize> for Index[src]

type Output = Index

The resulting type after applying the - operator.

impl Zeroable for Index[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsSlice<T> for T[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CallHasher for T where
    T: Hash

impl<T> CloneBytes for T where
    T: 'static + Clone
[src]

impl<T> CopyElem for T where
    T: Any + Copy
[src]

impl<T> DebugBytes for T where
    T: 'static + Debug
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> DropBytes for T where
    T: 'static, 
[src]

impl<T> Elem for T where
    T: Any + DropBytes
[src]

impl<T> From<T> for T[src]

impl<'a, S, I> Get<'a, I> for S where
    I: GetIndex<'a, S>, 
[src]

type Output = <I as GetIndex<'a, S>>::Output

impl<T> HashBytes for T where
    T: 'static + Hash
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<S, I> Isolate<I> for S where
    I: IsolateIndex<S>, 
[src]

type Output = <I as IsolateIndex<S>>::Output

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T> PartialEqBytes for T where
    T: 'static + PartialEq<T>, 
[src]

impl<T> Pod for T where
    T: 'static + Copy + Send + Sync + Any
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, N> PushArrayToVec<N> for T where
    T: Clone,
    N: Array<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.