Enable with task
feature. Provides C equivalents for Waker
, RawWaker
, RawWakerVtable
.
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 });
The following now compiles:
#[cglue_trait]
pub trait WithAssoc<T> {
type AssocTy: Clone;
fn with_assoc(&self, assoc: &Self::AssocTy) -> T;
}
The following now works:
async fn hii() -> u64 {
42
}
let obj = trait_obj!(hii() as Future);
assert_eq!(pollster::block_on(obj), 42);
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);
Automatically wrap 'Into' arguments
Initial support for GAT lifetimes
Allow to provide custom implemenetations for generics functions
Re-export custom_impl
macro.
Parse different expressions in the cast macros
- This is equivalent to
Arc
, and is essentially a pre-null-checked version ofCArc
.
Make cglue generated exports easier to import:
-
cglue_##trait_or_groupname
module is exposed as public that contains all types that are being re-exported to parent module. -
In the future, these types may not be re-exported anymore, and code generator may rely on
cglue_##trait_or_groupname
to exist in scope for cleaner code generation.
Add boxed slice, CVec, and add more serde support.
Compatible with official abi_stable:
-
Users should now use
cglue::trait_group::c_void
as thec_void
type. -
Technically breaks semver, but it is not possible to do anything with
c_void
anyways.
Make formatting traits FFI-safe:
-
All standard fmt traits are exposed.
-
Only Debug and Display are in the prefix.
-
Not full formatting functionality is preserved across FFI boundary.
Add extra customization to C function impls.
Make C++ generator to be C++11 friendly.
Fix no_std compilation.
-
Make code generator emit C functions that take in a single object that contains both the object and the return context. This simplifies usage from C/C++.
-
Remove zero wrapper optimization. The above is incompatible with it.
-
Remove CtxBox, as context has been moved into the container object.
Context is now always Clone + Send + Sync
.
Ergonomic C/C++ wrappers:
-
In C++ trait objects and groups have member functions and destructors defined. Trait objects and groups themselves are ABI-incompatible when passed by value.
-
In C there are inline functions for invoking behavior. Some of the functions accept void pointers, because they are compatible with multiple variations of the same CGlue object.
-
Ability to specify default container and context types, so that the wrappers become more compact.
-
Manual cleanup is no longer supported as bindgen has become more complex.
-
Stacked borrows are disabled.
-
ABI checks have been patched out, because otherwise rust evaluator does not accept type erasure.
- Provide Rust functionality in C/C++ with slightly different types.
Wrap strings and slices in return types.
Unstable feature to auto-impl groups:
-
Auto-enables the widest set of optional traits for any given type.
-
Makes
cglue_impl_group!
a no-op.
Runtime ABI/API validation with abi_stable.
Remove no_empty_retwrap feature.
Replace CArc with COptArc, make old CArc private:
- COptArc was always the prefered choice, as it allowed to also represent
None
in the same amount of space.