Zig doesn't have an interface keyword, but supports interface-like abstractions through manual vtables—a pattern used extensively in the standard library for allocators, readers, and writers. An interface in Zig consists of a pointer to opaque data and a collection of function pointers (vtable), forming a fat pointer similar to
1 Comment
Sort: