Generate Rust structs with serde Serialize and Deserialize derives from a nested application configuration. Paste your config JSON and get typed Rust code.
// Generated by DevBento — json-to-typescript
interface RootApp {
name: string;
version: string;
debug: boolean;
}
interface RootDatabaseCredentials {
user: string;
password: string;
}
interface RootDatabase {
host: string;
port: number;
credentials: RootDatabaseCredentials;
}
interface RootFeatures {
darkMode: boolean;
maxConnections: number;
allowedOrigins: string[];
}
interface Root {
app: RootApp;
database: RootDatabase;
features: RootFeatures;
}Application configs have deep nesting: app settings, database credentials, feature flags. This example generates Rust structs from a multi-level config structure so you can deserialize configuration files directly in your Rust application.
The tool produces:
Root struct with three top-level sections: App, Database, FeaturesRootApp struct with Name, Version, Debug fieldsRootDatabase struct with Host, Port, and Credentials nested structRootDatabaseCredentials struct for database authRootFeatures struct with DarkMode, MaxConnections, and AllowedOrigins vecString, i64, bool, Vec<String>Rust config libraries like config and figment work well with typed structs. Generate structs from your default config, then use serde_json::from_str or your config library’s decoder to populate them from JSON files, environment variables, or command-line flags.
Nothing you paste leaves this tab. Every tool runs entirely in your browser — no upload, no server, no account.