From 71c4317ea25ec5053d7f106bd25b29bcff6afb53 Mon Sep 17 00:00:00 2001 From: sirlilpanda Date: Fri, 29 May 2026 09:17:31 +1200 Subject: [PATCH] added instructions for adding to your zig project --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index ae2c636..da76063 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,25 @@ first why does this exist i didnt like having to write `*anyopaque` for all the functions that are in the implemention of an interface so i made wrapper do it for you. This now hides all the nasty polymorphism shenanigans within the interface where it belongs. Additionally it also allows you to use your implementation normally rather than having to pass it through the interface first. +# using this lib + +```bash +$ zig fetch --save git+https://git.sirlilpanda.studio/sirlilpanda/zig-interface-helpers +``` + +in `build.zig` +```zig + +const iface = b.dependency("interface", .{ + .target = target, + .optimize = optimize, +}); + +exe.root_module.addImport("interface", interface.module("interface")); + +``` + + # how does this lib work This lib basically removes the annoying conversion back to the original type in your implementation and instead does that conversion in a wrapper functions instead. This should now allow you to write more code and less boilerplate.