Add the serde derive feature to Cargo.toml and derive Serialize and Deserialize on your enum to enable serialization.
Add the serde dependency with the derive feature to your Cargo.toml, then derive Serialize and Deserialize on your enum definition.
[dependencies]
serde = { version = "1.0", features = ["derive"] }
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize)]
enum Status {
Active,
Inactive,
}
Serde is a tool that lets you save your Rust data to files or send it over the internet by converting it into text formats like JSON. Enums are lists of possible states, and Serde makes sure each state is saved correctly so you can read it back later. Think of it like labeling boxes with specific names so you know exactly what is inside when you unpack them.