100% Client-Side • 0 B Data Leaves Browser
Prettier & AST Engine
Formatters/Rust
Rust Formatter & Beautifier
Format, beautify, and validate Rust (Serde Structs) with instant linting diagnostics and error line indicators.
RustRust
.rs
use serde::{Serialize, Deserialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct UserProfile {
pub id: String,
pub name: String,
pub email: String,
#[serde(rename = "isActive")]
pub is_active: bool,
pub age: i64,
pub roles: Vec<String>,
pub preferences: Preferences,
pub metrics: Metrics,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Metrics {
#[serde(rename = "loginCount")]
pub login_count: i64,
#[serde(rename = "lastLatencyMs")]
pub last_latency_ms: f64,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Preferences {
pub theme: String,
pub notifications: Notifications,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Notifications {
pub email: bool,
pub sms: bool,
pub frequency: String,
}
Valid
35 lines871 chars871 B
.rs
Valid
0 lines0 chars0 B