# [−][src]Struct plexus::index::Flat

pub struct Flat<A = U3, N = usize> where    A: NonZero + Unsigned,    N: Copy + Integer + Unsigned,  { /* fields omitted */ }

Flat index buffer meta-grouping.

Describes a flat index buffer with a constant arity. Arity is specified using a type constant from the typenum crate.

Unlike structured groupings, this meta-grouping is needed to associate an index type with an arity. For example, Vec<usize> implements both IndexBuffer<Flat3<usize>> (a triangular buffer) and IndexBuffer<Flat4<usize>> (a quadrilateral buffer). Care must be taken when using flat index buffers, because they are more prone to mismatched arity than structured buffers.

# Examples

Creating a MeshBuffer with a flat and triangular index buffer:

use plexus::buffer::MeshBuffer;
use plexus::index::Flat;
use plexus::prelude::*;
use plexus::U3;

let mut buffer = MeshBuffer::<Flat<U3, usize>, (f64, f64, f64)>::default();

## Trait Implementations

### impl<A, N> Grouping for Flat<A, N> where    A: NonZero + Unsigned,    N: Copy + Integer + Unsigned, [src]

#### type Group = N

Flat index buffers directly contain indices. These indices are implicitly grouped by the arity of the buffer.

### impl<A, N> IndexBuffer<Flat<A, N>> for Vec<N> where    A: NonZero + Unsigned,    N: Copy + Integer + Unsigned, [src]

#### type Index = N

The type of individual indices in the buffer.

## Blanket Implementations

### impl<P> Grouping for P where    P: Topological,    <P as Topological>::Vertex: Copy,    <P as Topological>::Vertex: Integer,    <P as Topological>::Vertex: Unsigned, [src]

#### type Group = P

Topological index buffers contain $n$-gons that explicitly group their indices.

### impl<T> Same<T> for T

#### type Output = T

Should always be Self

### 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.