Crate const_util

Source
Expand description

Provides stable const implementations for some things missing from the standard library.

Currently implemented are

  • Functions in result to unwrap Results with generics or drop glue
  • Functions in the concat module to concat const strings and byte slices.
  • destruct_tuple to destructure tuples with generic types or types with drop glue in them
  • nonnull_from to create NonNulls from mutable and regular references conveniently
  • man_drop_ref/man_drop_mut as a workaround for the lack of const Deref implementations
  • Functions in slice to take subslices using ranges

Re-exports§

pub extern crate type_const;

Modules§

concat
Functions for concatenating slices
mem
Functions related to core::mem and core::ptr
result
Functions for unwrapping Results
slice
Const variants of functions for dealing with slices

Macros§

destruct_tuple
Allows destructuring tuples in const contexts, regardless of items having drop glue.

Traits§

Const
Describes a type that holds an associated const value.

Functions§

value_of
Alias for Const::VALUE. Prefer this function over accessing the const directly.