# Known Types
[](https://unlicense.org)
[](https://blog.rust-lang.org/2025/02/20/Rust-1.85.0/)
[](https://crates.io/crates/known-types)
[](https://docs.rs/known-types/)
Well-known types for Rust.
## ✨ Features
- Zero default dependencies, only optional [integrations](#integrations).
- Supports opting out of any feature using comprehensive [feature flags].
- Adheres to the Rust API Guidelines in its [naming conventions].
- 100% free and unencumbered public domain software.
## 🛠️ Prerequisites
- [Rust](https://rust-lang.org) 1.85+ (2024 edition)
## ⬇️ Installation
### Installation via Cargo
```bash
cargo add known-types
```
<details>
<summary>Instructions for each crate</summary>
### Installation via Cargo (all crates)
```bash
cargo add known-types
cargo add known-types-anthropic
cargo add known-types-google
cargo add known-types-graphql
cargo add known-types-ietf
cargo add known-types-nostr
cargo add known-types-openai
cargo add known-types-pypi
cargo add known-types-rubygems
cargo add known-types-w3c
cargo add known-types-x
```
</details>
### Installation in `Cargo.toml` (with all features enabled)
```toml
[dependencies]
known-types = "0.1"
```
<details>
<summary>Instructions for each crate</summary>
### Installation in `Cargo.toml` (with all features enabled, in all crates)
```toml
[dependencies]
known-types = "0.1"
known-types-anthropic = "0.1"
known-types-google = "0.1"
known-types-graphql = "0.1"
known-types-ietf = "0.1"
known-types-nostr = "0.1"
known-types-openai = "0.1"
known-types-pypi = "0.1"
known-types-rubygems = "0.1"
known-types-w3c = "0.1"
known-types-x = "0.1"
```
</details>
### Installation in `Cargo.toml` (with only specific features enabled)
```toml
[dependencies]
known-types = { version = "0.1", default-features = false, features = ["serde"] }
```
<details>
<summary>Instructions for each crate</summary>
### Installation in `Cargo.toml` (with only specific features enabled, in all crates)
```toml
[dependencies]
known-types = { version = "0.1", default-features = false, features = ["serde"] }
known-types-anthropic = { version = "0.1", default-features = false, features = ["serde"] }
known-types-google = { version = "0.1", default-features = false, features = ["serde"] }
known-types-graphql = { version = "0.1", default-features = false, features = ["serde"] }
known-types-ietf = { version = "0.1", default-features = false, features = ["serde"] }
known-types-nostr = { version = "0.1", default-features = false, features = ["serde"] }
known-types-openai = { version = "0.1", default-features = false, features = ["serde"] }
known-types-pypi = { version = "0.1", default-features = false, features = ["serde"] }
known-types-rubygems = { version = "0.1", default-features = false, features = ["serde"] }
known-types-w3c = { version = "0.1", default-features = false, features = ["serde"] }
known-types-x = { version = "0.1", default-features = false, features = ["serde"] }
```
</details>
## 👉 Examples
### Importing the library
```rust
use known_types;
```
<details>
<summary>Instructions for each crate</summary>
### Importing the library (all crates)
```rust
use known_types;
use known_types_anthropic;
use known_types_google;
use known_types_graphql;
use known_types_ietf;
use known_types_nostr;
use known_types_openai;
use known_types_pypi;
use known_types_rubygems;
use known_types_w3c;
use known_types_x;
```
</details>
## 📚 Reference
### Crates
[known-types] | [](https://crates.io/crates/known-types) | [](https://docs.rs/known-types/) | Well-known types.
[known-types-anthropic] | [](https://crates.io/crates/known-types-anthropic) | [](https://docs.rs/known-types-anthropic/) | Well-known types for Anthropic APIs.
[known-types-google] | [](https://crates.io/crates/known-types-google) | [](https://docs.rs/known-types-google/) | Well-known types for Google APIs.
[known-types-graphql] | [](https://crates.io/crates/known-types-graphql) | [](https://docs.rs/known-types-graphql/) | Well-known types for GraphQL specifications.
[known-types-ietf] | [](https://crates.io/crates/known-types-ietf) | [](https://docs.rs/known-types-ietf/) | Well-known types for IETF specifications.
[known-types-nostr] | [](https://crates.io/crates/known-types-nostr) | [](https://docs.rs/known-types-nostr/) | Well-known types for the Nostr protocol.
[known-types-openai] | [](https://crates.io/crates/known-types-openai) | [](https://docs.rs/known-types-openai/) | Well-known types for OpenAI APIs.
[known-types-pypi] | [](https://crates.io/crates/known-types-pypi) | [](https://docs.rs/known-types-pypi/) | Well-known types for Python Package Index (PyPI) APIs.
[known-types-rubygems] | [](https://crates.io/crates/known-types-rubygems) | [](https://docs.rs/known-types-rubygems/) | Well-known types for RubyGems.org APIs.
[known-types-w3c] | [](https://crates.io/crates/known-types-w3c) | [](https://docs.rs/known-types-w3c/) | Well-known types for W3C specifications.
[known-types-x] | [](https://crates.io/crates/known-types-x) | [](https://docs.rs/known-types-x/) | Well-known types for X (formerly Twitter) APIs.
<img width="220" height="1"/> | <img width="110" height="1"/> | <img width="100" height="1"/> |
### Integrations
[bincode] <sub>(`"bincode"`)</sub> | 2 | [](https://docs.rs/bincode/) | Derives `bincode::{Encode, Decode}`
[borsh] <sub>(`"borsh"`)</sub> | 1.5 | [](https://docs.rs/borsh/) | Derives `borsh::{BorshSerialize, BorshDeserialize}`
[musli] <sub>(`"musli"`)</sub> | 0.0.131 | [](https://docs.rs/musli/) | Derives `musli::{Encode, Decode}`
[rasn] <sub>(`"rasn"`)</sub> | 0.26 | [](https://docs.rs/rasn/) | Derives `rasn::AsnType` with `rasn(automatic_tags)`
[serde] <sub>(`"serde"`)</sub> | 1 | [](https://docs.rs/serde/) | Derives `serde::{Serialize, Deserialize}`
<img width="220" height="1"/> | <img width="110" height="1"/> | <img width="100" height="1"/> |
## 👨💻 Development
```bash
git clone https://github.com/known-facts/known-types.git
```
---
[](https://x.com/intent/post?url=https://github.com/known-facts/known-types&text=Known%20Types)
[](https://reddit.com/submit?url=https://github.com/known-facts/known-types&title=Known%20Types)
[](https://news.ycombinator.com/submitlink?u=https://github.com/known-facts/known-types&t=Known%20Types)
[](https://www.facebook.com/sharer/sharer.php?u=https://github.com/known-facts/known-types)
[](https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/known-facts/known-types)
[feature flags]: https://github.com/known-facts/known-types/blob/master/lib/known-types/Cargo.toml
[naming conventions]: https://rust-lang.github.io/api-guidelines/naming.html
[bincode]: https://crates.io/crates/bincode
[borsh]: https://crates.io/crates/borsh
[musli]: https://crates.io/crates/musli
[rasn]: https://crates.io/crates/rasn
[serde]: https://crates.io/crates/serde
[known-types]: https://github.com/known-facts/known-types/tree/master/lib/known-types
[known-types-anthropic]: https://github.com/known-facts/known-types/tree/master/lib/known-types-anthropic
[known-types-google]: https://github.com/known-facts/known-types/tree/master/lib/known-types-google
[known-types-graphql]: https://github.com/known-facts/known-types/tree/master/lib/known-types-graphql
[known-types-ietf]: https://github.com/known-facts/known-types/tree/master/lib/known-types-ietf
[known-types-nostr]: https://github.com/known-facts/known-types/tree/master/lib/known-types-nostr
[known-types-openai]: https://github.com/known-facts/known-types/tree/master/lib/known-types-openai
[known-types-pypi]: https://github.com/known-facts/known-types/tree/master/lib/known-types-pypi
[known-types-rubygems]: https://github.com/known-facts/known-types/tree/master/lib/known-types-rubygems
[known-types-w3c]: https://github.com/known-facts/known-types/tree/master/lib/known-types-w3c
[known-types-x]: https://github.com/known-facts/known-types/tree/master/lib/known-types-x