pub trait AsyncFrom { async fn async_from(source: T) -> Self; } pub trait AsyncInto { async fn async_into(self) -> T; } impl AsyncInto for U where T: AsyncFrom { async fn async_into(self) -> T { T::async_from(self).await } } pub trait AsyncTryFrom: Sized { type Error: Sized; async fn async_try_from(source: T) -> Result; } pub trait AsyncTryInto: Sized{ type Error: Sized; async fn async_try_into(self) -> Result; } impl AsyncTryInto for U where T: AsyncTryFrom { type Error = >::Error; async fn async_try_into(self) -> Result { T::async_try_from(self).await } }