Skip to content

Commit

Permalink
Merge pull request #13 from flxzt/impl-ctx-binding
Browse files Browse the repository at this point in the history
implement `Binding` trait for Context
  • Loading branch information
rwestphal authored Apr 4, 2024
2 parents b7316aa + 2576fc9 commit 99ec898
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>(
Expand Down

0 comments on commit 99ec898

Please sign in to comment.