Async trait methods for no_std
Features like async-trait
, avoid using Box
and dyn
.
This crate is ready for #![no_std]
when PR69033 merged.
Thanks to crate async-trait, some code from these.
WARNING: This crate use some unstable even incomplete feature. You will get some warning from compiler.
Features
-
Self
-
Self
by reference. -
Self
by value. -
Self
by mut reference. - no
Self
. - any type of
Self
.
-
- Any number of arguments, any return value.
- Arguments.
- As value.
- As reference without lifetime.
- Return value expect reference (return reference at
Lifetime return
).
- Arguments.
- Lifetime parameters.
- Lifetime arguments.
- Lifetime return.
- Associated types support.
- Having async and non-async functions in the same trait.
Incomplete Feature
These feature all require
generic_associated_types
support type arguments.
Following issue: #44265
- support default
async fn
implementations in trait (Wait featuregeneric_associated_types
support type arguments). - Generic type parameters.
- Generic arguments (Wait for feature
generic_associated_types
support type arguments). - Generic return (Wait for feature
generic_associated_types
support type arguments). -
impl trait
in arguments (Wait for featuregeneric_associated_types
support type arguments).
- Generic arguments (Wait for feature
Usage
Please enable feature type_alias_impl_trait
and generic_associated_types
;
use async_trait;
async
;