pub trait TwoComponent {
type Val;
// Required methods
fn from_components(c1: Self::Val, c2: Self::Val) -> Self;
fn to_components(self) -> (Self::Val, Self::Val);
fn comp1(&self) -> &Self::Val;
fn comp2(&self) -> &Self::Val;
}Expand description
Trait that represents types that have two components.
Required Associated Types§
Required Methods§
Sourcefn from_components(c1: Self::Val, c2: Self::Val) -> Self
fn from_components(c1: Self::Val, c2: Self::Val) -> Self
Creates two component value from its components.
Sourcefn to_components(self) -> (Self::Val, Self::Val)
fn to_components(self) -> (Self::Val, Self::Val)
Gets the components.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".