playground_api/endpoints/
crates.rs

1use serde::{Deserialize, Serialize};
2
3/// Represents metadata about a crate available on the Rust playground.
4///
5/// Includes the crate's name, version, and unique identifier.
6#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
7pub struct CrateInformation {
8    /// The name of the crate.
9    pub name: String,
10    /// The version of the crate.
11    pub version: String,
12    /// The unique identifier for the crate.
13    pub id: String,
14}
15
16/// A response containing a list of available crates on the Rust playground.
17///
18/// Each crate is represented by a [`CrateInformation`] struct.
19#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
20pub struct CratesResponse {
21    /// A list of available crates.
22    pub crates: Vec<CrateInformation>,
23}