Move Engine functions and iterators lib to Packages API.

This commit is contained in:
Stephen Chung
2020-05-07 15:25:50 +08:00
parent f3c0609377
commit c607c7c428
5 changed files with 106 additions and 57 deletions

View File

@@ -168,7 +168,9 @@ impl Engine {
/// Register an iterator adapter for a type with the `Engine`.
/// This is an advanced feature.
pub fn register_iterator<T: Variant + Clone, F: IteratorCallback>(&mut self, f: F) {
self.type_iterators.insert(TypeId::of::<T>(), Box::new(f));
self.base_package
.type_iterators
.insert(TypeId::of::<T>(), Box::new(f));
}
/// Register a getter function for a member of a registered type with the `Engine`.