oc2_hlapi_v2 0.2.0

A client for the new version of OpenComputers II's HLAPI
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use serde::{Deserialize, Serialize};
use serde_json::Value as JsonValue;
use std::collections::HashMap;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
/// An item stack
pub struct ItemStack {
    /// The item's ID
    ///
    /// A custom datapack can in theory prevent access to the ID, so it is an [`Option`] as a
    /// result. Unwrapping this to access the ID will never fail normally.
    pub id: Option<String>,
    /// The number of items in the stack
    pub count: u32,
    /// The item's data components
    #[serde(default)]
    pub components: HashMap<String, JsonValue>,
}