pub trait Convert<A: Clone, B: Clone> {
    // Provided methods
    fn convert(value: A) -> Result<B, A> { ... }
    fn convert_ref(value: impl Borrow<A>) -> Result<B, ()> { ... }
    fn reverse(value: B) -> Result<A, B> { ... }
    fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()> { ... }
}
Expand description

Generic third-party conversion trait. Use this when you don’t want to force the user to use default implementations of From and Into for the types you wish to convert between.

One of convert/convert_ref and reverse/reverse_ref MUST be implemented. If possible, implement convert_ref, since this will never result in a clone. Use convert when you definitely need to consume the source value.

Can be amalgamated into tuples. If any of the tuple elements converts into Ok(_) it short circuits. Otherwise returns the Err(_) of the last failing conversion (or Err(()) for ref conversions).

Provided Methods§

source

fn convert(value: A) -> Result<B, A>

Convert from value (of type A) into an equivalent value of type B, Err if not possible.

source

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source

fn reverse(value: B) -> Result<A, B>

Convert from value (of type B) into an equivalent value of type A, Err if not possible.

source

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

Implementations on Foreign Types§

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone> Convert<A, B> for ()

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>, TupleElement16: Convert<A, B>, TupleElement17: Convert<A, B>, TupleElement18: Convert<A, B>, TupleElement19: Convert<A, B>, TupleElement20: Convert<A, B>, TupleElement21: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>, TupleElement16: Convert<A, B>, TupleElement17: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>, TupleElement16: Convert<A, B>, TupleElement17: Convert<A, B>, TupleElement18: Convert<A, B>, TupleElement19: Convert<A, B>, TupleElement20: Convert<A, B>, TupleElement21: Convert<A, B>, TupleElement22: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>, TupleElement16: Convert<A, B>, TupleElement17: Convert<A, B>, TupleElement18: Convert<A, B>, TupleElement19: Convert<A, B>, TupleElement20: Convert<A, B>, TupleElement21: Convert<A, B>, TupleElement22: Convert<A, B>, TupleElement23: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>, TupleElement16: Convert<A, B>, TupleElement17: Convert<A, B>, TupleElement18: Convert<A, B>, TupleElement19: Convert<A, B>, TupleElement20: Convert<A, B>, TupleElement21: Convert<A, B>, TupleElement22: Convert<A, B>, TupleElement23: Convert<A, B>, TupleElement24: Convert<A, B>, TupleElement25: Convert<A, B>, TupleElement26: Convert<A, B>, TupleElement27: Convert<A, B>, TupleElement28: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>, TupleElement16: Convert<A, B>, TupleElement17: Convert<A, B>, TupleElement18: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>, TupleElement16: Convert<A, B>, TupleElement17: Convert<A, B>, TupleElement18: Convert<A, B>, TupleElement19: Convert<A, B>, TupleElement20: Convert<A, B>, TupleElement21: Convert<A, B>, TupleElement22: Convert<A, B>, TupleElement23: Convert<A, B>, TupleElement24: Convert<A, B>, TupleElement25: Convert<A, B>, TupleElement26: Convert<A, B>, TupleElement27: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>, TupleElement16: Convert<A, B>, TupleElement17: Convert<A, B>, TupleElement18: Convert<A, B>, TupleElement19: Convert<A, B>, TupleElement20: Convert<A, B>, TupleElement21: Convert<A, B>, TupleElement22: Convert<A, B>, TupleElement23: Convert<A, B>, TupleElement24: Convert<A, B>, TupleElement25: Convert<A, B>, TupleElement26: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>> Convert<A, B> for (TupleElement0,)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>, TupleElement16: Convert<A, B>, TupleElement17: Convert<A, B>, TupleElement18: Convert<A, B>, TupleElement19: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>, TupleElement16: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>, TupleElement16: Convert<A, B>, TupleElement17: Convert<A, B>, TupleElement18: Convert<A, B>, TupleElement19: Convert<A, B>, TupleElement20: Convert<A, B>, TupleElement21: Convert<A, B>, TupleElement22: Convert<A, B>, TupleElement23: Convert<A, B>, TupleElement24: Convert<A, B>, TupleElement25: Convert<A, B>, TupleElement26: Convert<A, B>, TupleElement27: Convert<A, B>, TupleElement28: Convert<A, B>, TupleElement29: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28, TupleElement29)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>, TupleElement16: Convert<A, B>, TupleElement17: Convert<A, B>, TupleElement18: Convert<A, B>, TupleElement19: Convert<A, B>, TupleElement20: Convert<A, B>, TupleElement21: Convert<A, B>, TupleElement22: Convert<A, B>, TupleElement23: Convert<A, B>, TupleElement24: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>, TupleElement16: Convert<A, B>, TupleElement17: Convert<A, B>, TupleElement18: Convert<A, B>, TupleElement19: Convert<A, B>, TupleElement20: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

source§

impl<A: Clone, B: Clone, TupleElement0: Convert<A, B>, TupleElement1: Convert<A, B>, TupleElement2: Convert<A, B>, TupleElement3: Convert<A, B>, TupleElement4: Convert<A, B>, TupleElement5: Convert<A, B>, TupleElement6: Convert<A, B>, TupleElement7: Convert<A, B>, TupleElement8: Convert<A, B>, TupleElement9: Convert<A, B>, TupleElement10: Convert<A, B>, TupleElement11: Convert<A, B>, TupleElement12: Convert<A, B>, TupleElement13: Convert<A, B>, TupleElement14: Convert<A, B>, TupleElement15: Convert<A, B>, TupleElement16: Convert<A, B>, TupleElement17: Convert<A, B>, TupleElement18: Convert<A, B>, TupleElement19: Convert<A, B>, TupleElement20: Convert<A, B>, TupleElement21: Convert<A, B>, TupleElement22: Convert<A, B>, TupleElement23: Convert<A, B>, TupleElement24: Convert<A, B>, TupleElement25: Convert<A, B>> Convert<A, B> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25)

source§

fn convert(value: A) -> Result<B, A>

source§

fn reverse(value: B) -> Result<A, B>

source§

fn convert_ref(value: impl Borrow<A>) -> Result<B, ()>

source§

fn reverse_ref(value: impl Borrow<B>) -> Result<A, ()>

Implementors§

source§

impl<Source: TryFrom<Dest> + Clone, Dest: TryFrom<Source> + Clone> Convert<Source, Dest> for JustTry

source§

impl<T: Clone + Encode + Decode> Convert<Vec<u8, Global>, T> for Decoded

source§

impl<T: Clone + Encode + Decode> Convert<T, Vec<u8, Global>> for Encoded

source§

impl<T: Clone> Convert<T, T> for Identity