Skip to content

v0.3.4

Latest
Compare
Choose a tag to compare
@h33p h33p released this 31 Jul 21:28
5384133

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);

Fix #17

Add Send bound to Opaquable for CBox to hack around a soundness issue