pub trait MaybeEquivalence<A, B> {
// Required methods
fn convert(a: &A) -> Option<B>;
fn convert_back(b: &B) -> Option<A>;
}
Expand description
Definition for a bi-directional, fallible conversion between two types.
Required Methods§
sourcefn convert(a: &A) -> Option<B>
fn convert(a: &A) -> Option<B>
Attempt to convert reference of A
into value of B
, returning None
if not possible.
sourcefn convert_back(b: &B) -> Option<A>
fn convert_back(b: &B) -> Option<A>
Attempt to convert reference of B
into value of A
, returning None
if not possible.
Object Safety§
This trait is not object safe.