// adapters keep canonical wrapper identity when queries cross handles. module engine pub fn (mut handle Handle) bind_context(context voidptr) ! { handle.require_live()! if context == unsafe { nil } || handle.binding_data != unsafe { nil } { return handle.fail(.wrong_args, 'binding context is null or already set') } handle.binding_data = context } pub fn (handle &Handle) binding_context() voidptr { if handle == unsafe { nil } { return unsafe { nil } } return handle.binding_data } pub fn (pkg &Package) binding_context() voidptr { if pkg == unsafe { nil } { return unsafe { nil } } return pkg.owner.binding_context() } pub fn (db &Database) binding_context() voidptr { if db == unsafe { nil } { return unsafe { nil } } return db.owner.binding_context() }