Wingback, a B2B SaaS company, open-sourced a Rust library called 'kind' that solves the problem of typed identifiers. Using PhantomData and a derive macro, it creates zero-cost typed IDs like Id<Customer> that prevent identifier misuse at compile time. In JSON/REST APIs, IDs are automatically prefixed (e.g., 'Cust_uuid'), making them human-readable and self-documenting. The library integrates with serde for serialization and sqlx for database queries, requires no boilerplate, and also provides an Ided<T> wrapper to distinguish objects with and without IDs.
Table of contents
WhyWhat it looks likeWhat it really is, how it worksIdentified objectParse/Write, (de)serializeQuery the databaseAnd moreSort: