pub struct ShipModule {
pub symbol: Symbol,
pub capacity: Option<u32>,
pub range: Option<u32>,
pub name: String,
pub description: String,
pub requirements: ShipRequirements,
}Expand description
A module can be installed in a ship and provides a set of capabilities such as storage space or quarters for crew. Module installations are permanent.
Fields§
§symbol: SymbolThe symbol of the module.
capacity: Option<u32>Modules that provide capacity, such as cargo hold or crew quarters will show this value to denote how much of a bonus the module grants.
range: Option<u32>Modules that have a range will such as a sensor array show this value to denote how far can the module reach with its capabilities.
name: StringName of this module.
description: StringDescription of this module.
requirements: ShipRequirementsImplementations§
Source§impl ShipModule
impl ShipModule
Sourcepub fn new(
symbol: Symbol,
name: String,
description: String,
requirements: ShipRequirements,
) -> ShipModule
pub fn new( symbol: Symbol, name: String, description: String, requirements: ShipRequirements, ) -> ShipModule
Create value with optional fields set to None.
Trait Implementations§
Source§impl Clone for ShipModule
impl Clone for ShipModule
Source§fn clone(&self) -> ShipModule
fn clone(&self) -> ShipModule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShipModule
impl Debug for ShipModule
Source§impl<'de> Deserialize<'de> for ShipModule
impl<'de> Deserialize<'de> for ShipModule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 PartialEq for ShipModule
impl PartialEq for ShipModule
Source§impl Serialize for ShipModule
impl Serialize for ShipModule
impl StructuralPartialEq for ShipModule
Auto Trait Implementations§
impl Freeze for ShipModule
impl RefUnwindSafe for ShipModule
impl Send for ShipModule
impl Sync for ShipModule
impl Unpin for ShipModule
impl UnwindSafe for ShipModule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more