@@ -47,6 +47,7 @@ mod private
4747 /// println!( "Converted: {}", num.0 );
4848 /// }
4949 /// ```
50+ #[ cfg( feature = "async_from" ) ]
5051 #[ async_trait ]
5152 pub trait AsyncFrom < T > : Sized
5253 {
@@ -91,6 +92,7 @@ mod private
9192 /// }
9293 /// ```
9394 #[ async_trait ]
95+ #[ cfg( feature = "async_from" ) ]
9496 pub trait AsyncInto < T > : Sized
9597 {
9698 /// Asynchronously converts `Self` into a value of type `T`.
@@ -105,6 +107,7 @@ mod private
105107 ///
106108 /// This implementation allows any type `T` that implements `AsyncFrom<U>` to also implement `AsyncInto<U>`.
107109 #[ async_trait ]
110+ #[ cfg( feature = "async_from" ) ]
108111 impl < T , U > AsyncInto < U > for T
109112 where
110113 U : AsyncFrom < T > + Send ,
@@ -156,6 +159,7 @@ mod private
156159 /// }
157160 /// ```
158161 #[ async_trait ]
162+ #[ cfg( feature = "async_try_from" ) ]
159163 pub trait AsyncTryFrom < T > : Sized
160164 {
161165 /// The error type returned if the conversion fails.
@@ -209,6 +213,7 @@ mod private
209213 /// }
210214 /// ```
211215 #[ async_trait ]
216+ #[ cfg( feature = "async_try_from" ) ]
212217 pub trait AsyncTryInto < T > : Sized
213218 {
214219 /// The error type returned if the conversion fails.
@@ -226,6 +231,7 @@ mod private
226231 ///
227232 /// This implementation allows any type `T` that implements `AsyncTryFrom<U>` to also implement `AsyncTryInto<U>`.
228233 #[ async_trait ]
234+ #[ cfg( feature = "async_try_from" ) ]
229235 impl < T , U > AsyncTryInto < U > for T
230236 where
231237 U : AsyncTryFrom < T > + Send ,
@@ -283,14 +289,22 @@ pub mod exposed
283289 pub use prelude:: * ;
284290
285291 #[ doc( inline ) ]
292+ pub use :: async_trait:: async_trait;
293+
294+ #[ cfg( feature = "async_from" ) ]
286295 pub use private::
287296 {
288- async_trait,
289297 AsyncFrom ,
290298 AsyncInto ,
299+ } ;
300+
301+ #[ cfg( feature = "async_try_from" ) ]
302+ pub use private::
303+ {
291304 AsyncTryFrom ,
292305 AsyncTryInto ,
293306 } ;
307+
294308}
295309
296310/// Prelude to use essentials: `use my_module::prelude::*`.
0 commit comments