Isomorphic

Trait Isomorphic 

Source
pub trait Isomorphic<T = Self> {
    // Required methods
    fn from_iso(t: T) -> Self;
    fn to_iso(self) -> T;
}
Expand description

Relates two types if they have the same canonical form.

The simplest and best way to implement Isomorphic for a non-tuple type is to implement NonTuple. You are discouraged from implementing Isomorphic<T> for T explicitly, because that won’t be sufficient to implement Isomorphic for tuples containing T.

Required Methods§

Source

fn from_iso(t: T) -> Self

Source

fn to_iso(self) -> T

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Flatten, U: Flatten<Flat = T::Flat>> Isomorphic<T> for U