From 2576fc9811c5bcc9dd5e74ff94d84d772447eed1 Mon Sep 17 00:00:00 2001 From: Felix Zwettler Date: Mon, 29 Jan 2024 14:34:44 +0100 Subject: [PATCH] implement `Binding` trait for Context --- src/context.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/context.rs b/src/context.rs index 9a182a1..c71e6d6 100644 --- a/src/context.rs +++ b/src/context.rs @@ -506,6 +506,20 @@ impl EmbeddedModuleKey { } } +unsafe impl<'a> Binding<'a> for Context { + type CType = ffi::ly_ctx; + type Container = (); + + unsafe fn from_raw( + _: &'a Self::Container, + raw: *mut Self::CType, + ) -> Self { + Self { + raw, + } + } +} + // ===== helper functions ===== fn find_embedded_module<'a>(