Skip to main content

TypeConstructible

Trait TypeConstructible 

Source
pub trait TypeConstructible: Sized + From<UIntType> {
Show 18 methods // Required methods fn either(left: Self, right: Self) -> Self; fn option(inner: Self) -> Self; fn boolean() -> Self; fn tuple<I: IntoIterator<Item = Self>>(elements: I) -> Self; fn array(element: Self, size: usize) -> Self; fn list(element: Self, bound: NonZeroPow2Usize) -> Self; // Provided methods fn unit() -> Self { ... } fn product(left: Self, right: Self) -> Self { ... } fn byte_array(size: usize) -> Self { ... } fn u1() -> Self { ... } fn u2() -> Self { ... } fn u4() -> Self { ... } fn u8() -> Self { ... } fn u16() -> Self { ... } fn u32() -> Self { ... } fn u64() -> Self { ... } fn u128() -> Self { ... } fn u256() -> Self { ... }
}
Expand description

Various type constructors.

Required Methods§

Source

fn either(left: Self, right: Self) -> Self

Create a sum of the given left and right types.

Source

fn option(inner: Self) -> Self

Create an option of the given inner type.

Source

fn boolean() -> Self

Create the Boolean type.

Source

fn tuple<I: IntoIterator<Item = Self>>(elements: I) -> Self

Create a tuple from the given elements.

The empty tuple is the unit type. A tuple of two types is a product.

Source

fn array(element: Self, size: usize) -> Self

Create an array with size many values of the element type.

Source

fn list(element: Self, bound: NonZeroPow2Usize) -> Self

Create a list with less than bound many values of the element type.

Provided Methods§

Source

fn unit() -> Self

Create the unit type.

Source

fn product(left: Self, right: Self) -> Self

Create a product of the given left and right types.

Source

fn byte_array(size: usize) -> Self

Create an array of size many bytes.

Source

fn u1() -> Self

Create the type of 1-bit integers.

Source

fn u2() -> Self

Create the type of 2-bit integers.

Source

fn u4() -> Self

Create the type of 4-bit integers.

Source

fn u8() -> Self

Create the type of 8-bit integers.

Source

fn u16() -> Self

Create the type of 16-bit integers.

Source

fn u32() -> Self

Create the type of 32-bit integers.

Source

fn u64() -> Self

Create the type of 64-bit integers.

Source

fn u128() -> Self

Create the type of 128-bit integers.

Source

fn u256() -> Self

Create the type of 256-bit integers.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§