Struct ModInfoBuilder

Source
pub struct ModInfoBuilder { /* private fields */ }
Expand description

Contains an internal ModInfo value that is used to later construct a finished ModInfo`.

Implementations§

Source§

impl ModInfoBuilder

Contains methods to successively build up a ModInfo struct.

Source

pub fn contact<T: Into<String>>(&mut self, contact: T) -> &mut Self

Sets the contact field.

Source

pub fn homepage(&mut self, homepage: Url) -> &mut Self

Sets the homepage field.

Source

pub fn description<T: Into<String>>(&mut self, description: T) -> &mut Self

Sets the description field.

Source

pub fn factorio_version( &mut self, factorio_version: FactorioVersion, ) -> &mut Self

Sets the factorio_version field.

Source

pub fn dependency(&mut self, dependency: Dependency) -> &mut Self

Adds a dependency to dependencies.

Source

pub fn dependencies(&mut self, dependencies: &[Dependency]) -> &mut Self

Adds multiple dependencies at once to dependencies.

Source

pub fn information_path<T: Into<PathBuf>>(&mut self, path: T) -> &mut Self

Sets a path to the readme file that should be displayed on the mod portal.

The path is relative to where the info.json file is located.

Note: This is an unofficial extension to the info.json format.

Source

pub fn faq_path<T: Into<PathBuf>>(&mut self, path: T) -> &mut Self

Sets a path to the FAQ file that should be displayed on the mod portal.

The path is relative to where the info.json file is located.

Source

pub fn gallery<T: Into<PathBuf>>(&mut self, gallery: T) -> &mut Self

Adds a path to the collection of gallery images.

Source

pub fn build(&mut self) -> ModInfo

Builds a finished ModInfo from the builder.

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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T