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-
Selfby reference. -
Selfby value. -
Selfby 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_typessupport type arguments.
Following issue: #44265
- support default
async fnimplementations in trait (Wait featuregeneric_associated_typessupport type arguments). - Generic type parameters.
- Generic arguments (Wait for feature
generic_associated_typessupport type arguments). - Generic return (Wait for feature
generic_associated_typessupport type arguments). -
impl traitin arguments (Wait for featuregeneric_associated_typessupport type arguments).
- Generic arguments (Wait for feature
Usage
Please enable feature type_alias_impl_trait and generic_associated_types;
use async_trait;
async
;