Trait constmuck::Infer [−][src]
Expand description
For constructing Is*
types (values that represent trait bounds),
and tuples of them.
For a more concise way to write Infer::INFER
, there’s the infer
macro.
Example
Basic
This example demonstrates how you can use the INFER
associated constant
instead of using the infer
macro.
use constmuck::{cast, wrapper};
use constmuck::{Infer};
use std::num::Wrapping;
const FOO: [i8; 3] = cast([3u8, 5, u8::MAX - 1], Infer::INFER);
assert_eq!(FOO, [3, 5, -2]);
const BAR: &[Wrapping<i8>] = wrapper::wrap_slice(&[13, 21, 34], Infer::INFER);
assert_eq!(BAR, &[Wrapping(13), Wrapping(21), Wrapping(34)]);