Changes in 0.3.4:
Stabilize task
feature
Enable with task
feature. Provides C equivalents for Waker
, RawWaker
, RawWakerVtable
.
Trait alias within trait groups
Enables specifying different generic instantiations of the same trait in the same group. Example:
cglue_trait_group!(TestGroupGen, TT<u8>, { TT<usize> = TTUsize, TT<u64> = TTUSixtyFour });
cglue_impl_group!(SA, TestGroupGen, { TT<usize> = TTUsize });
Support traits with associated types
The following now compiles:
#[cglue_trait]
pub trait WithAssoc<T> {
type AssocTy: Clone;
fn with_assoc(&self, assoc: &Self::AssocTy) -> T;
}
Add Future support + Pin Self parameters
The following now works:
async fn hii() -> u64 {
42
}
let obj = trait_obj!(hii() as Future);
assert_eq!(pollster::block_on(obj), 42);
Add futures Stream+Sink support
The following now works:
let items = [42, 43, 42];
let obj = trait_obj!(futures::stream::iter(items) as Stream);
assert_eq!(pollster::block_on(obj.collect::<Vec<_>>()), items);