PrototypeApi

Struct PrototypeApi 

Source
pub struct PrototypeApi {
    pub application: String,
    pub application_version: String,
    pub api_version: Number,
    pub stage: String,
    pub prototypes: Vec<Prototype>,
    pub types: Vec<Concept>,
    pub defines: Vec<Define>,
}
Expand description

The JSON, deserializable from the machine-readable JSON format file.

See the Factorio documentation for more details.

Fields§

§application: String

The application this documentation is for. Will always be "factorio".

§application_version: String

The version of the game that this documentation is for. An example would be "1.1.90".

§api_version: Number

The version of the machine-readable format itself. It is incremented every time the format changes.

§stage: String

Indicates the state this documentation is for. Will always be "prototype" (as opposed to "runtime"; see the data lifecycle for more detail).

§prototypes: Vec<Prototype>

The list of prototypes that can be created. Equivalent to the prototypes page.

§types: Vec<Concept>

The list of types (concepts) that the prototypes use. Equivalent to the types page.

§defines: Vec<Define>

The list of defines that the game uses. Equivalent to the defines page.

Implementations§

Source§

impl PrototypeApi

Source

pub fn try_from_file<P: AsRef<Path>>(path: P) -> Result<Self, LoadingError>

Reads the JSON data from the prototype-api.json file.

Trait Implementations§

Source§

impl Debug for PrototypeApi

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PrototypeApi

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PrototypeApi

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,