Crate generic_arrayvec[][src]

This crate provides interop between the arrayvec and generic_array crates, allowing you to use generic_array's GenericArray as the backing storage for the data structures in arrayvec. This lets you have vector and string types that store their contents inline, with a capacity that can be referred to in generic code.

Usage

This crate exposes the type aliases GenericArrayVecs and GenericArrayString, which are aliases of datatypes in the arrayvec crate, so see the ArrayVec and ArrayString docs to learn about their core functionality. Each one also has a corresponding extension trait GenericArrayVecExt and GenericArrayStringExt that provide additional constructors and conversions.

An example of instanciating and pushing an item onto a GenericArrayVec:

use generic_arrayvec::{GenericArrayVec, typenum::U5};

// Create a new GenericArrayVec of inferred element type with a capacity of 5
let mut arr = GenericArrayVec::<_, U5>::new();

arr.push(10);

Re-exports

pub extern crate arrayvec;
pub extern crate generic_array;

Modules

typenum

This crate provides type-level numbers evaluated at compile time. It depends only on libcore.

Structs

Wrapper

A wrapper around a GenericArray that implements the Array trait, allowing it to be used as the backing store for ArrayVec and ArrayString.

Traits

GenericArrayStringExt

Extension trait for GenericArrayString.

GenericArrayVecExt

Extension trait for GenericArrayVec.

Type Definitions

GenericArrayString

A GenericArray-backed ArrayString.

GenericArrayVec

A GenericArray-backed ArrayVec.