factorio-prototypes-json 0.1.0

Rust types that parse Factorio's Prototype JSON Format.
Documentation
//! Common format for several API members' basic fields.

use serde::{Deserialize, Serialize};
use serde_json::Number;

use super::image::Image;

/// Several API members follow a common format for their basic fields.
///
/// This is indicated by a field of type [`BasicMembers`].
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
pub struct BasicMembers {
    /// The name of the member.
    pub name: String,

    /// The order of the member as shown in the HTML.
    pub order: Number,

    /// The text description or the member. Can be empty.
    pub description: String,

    /// A list of Markdown lists to provide additional information. Usually contained in a spoiler tag.
    pub lists: Option<Vec<String>>,

    /// A list of code-only examples about the member.
    pub examples: Option<Vec<String>>,

    /// A list of illustrative images shown next to the member.
    pub images: Option<Vec<Image>>,
}