Crate coe

Source
Expand description

coe-rs is a Rust library for coercing a value of a given type into the same type, in cases where the compiler can’t prove the two types are equal.
This can be used to emulate specialization in to a limited extent.

Traits§

Coerce
Trait for performing coercion from one type to another, where the types are identical but the compiler can’t prove it.

Functions§

assert_same
Checks if T and U are the same type, and panics if that’s not the case.
coerce
Free function that defers to the Coerce trait implementation.
coerce_static
Similar to coerce but operates on any lifetime-free type.
is_same
Returns true if T and U are the same type.