Enum StoreObject

Source
pub enum StoreObject {
Show 19 variants Creep(Creep), PowerCreep(PowerCreep), Reactor(Reactor), Ruin(Ruin), ScoreCollector(ScoreCollector), ScoreContainer(ScoreContainer), StructureContainer(StructureContainer), StructureExtension(StructureExtension), StructureFactory(StructureFactory), StructureLab(StructureLab), StructureLink(StructureLink), StructureNuker(StructureNuker), StructurePowerSpawn(StructurePowerSpawn), StructureSpawn(StructureSpawn), StructureStorage(StructureStorage), StructureTerminal(StructureTerminal), StructureTower(StructureTower), SymbolContainer(SymbolContainer), Tombstone(Tombstone),
}

Variants§

§

Creep(Creep)

§

PowerCreep(PowerCreep)

§

Reactor(Reactor)

Available on crate feature seasonal-season-5 only.
§

Ruin(Ruin)

§

ScoreCollector(ScoreCollector)

Available on crate feature seasonal-season-1 only.
§

ScoreContainer(ScoreContainer)

Available on crate feature seasonal-season-1 only.
§

StructureContainer(StructureContainer)

§

StructureExtension(StructureExtension)

§

StructureFactory(StructureFactory)

§

StructureLab(StructureLab)

§

StructureNuker(StructureNuker)

§

StructurePowerSpawn(StructurePowerSpawn)

§

StructureSpawn(StructureSpawn)

§

StructureStorage(StructureStorage)

§

StructureTerminal(StructureTerminal)

§

StructureTower(StructureTower)

§

SymbolContainer(SymbolContainer)

Available on crate feature seasonal-season-2 only.
§

Tombstone(Tombstone)

Implementations§

Source§

impl StoreObject

Source

pub const fn resource_types(&self) -> &'static [ResourceType]

All possible resources that this store may hold.

Note: StructureLab is slightly odd in that it can hold any possible resource (including non-lab resources like power), but only one non-energy resource at a time.

§Example

Assuming that store_object is a StoreObject::StructureExtension:

assert_eq!(store_object.resource_types(), &[ResourceType::Energy]);

To access this property from a StructureObject, use the following conversion:

let ty: Result<&[ResourceType], StoreObjectConversionError> =
    StoreObject::try_from(structure_object).map(|store_obj| store_obj.resource_types());

Data collected on 2024-02-29 from https://github.com/screeps/engine/tree/97c9d12385fed686655c13b09f5f2457dd83a2bf

Trait Implementations§

Source§

impl From<Creep> for StoreObject

Source§

fn from(v: Creep) -> StoreObject

Converts to this type from the input type.
Source§

impl From<PowerCreep> for StoreObject

Source§

fn from(v: PowerCreep) -> StoreObject

Converts to this type from the input type.
Source§

impl From<Reactor> for StoreObject

Available on crate feature seasonal-season-5 only.
Source§

fn from(v: Reactor) -> StoreObject

Converts to this type from the input type.
Source§

impl From<Ruin> for StoreObject

Source§

fn from(v: Ruin) -> StoreObject

Converts to this type from the input type.
Source§

impl From<ScoreCollector> for StoreObject

Available on crate feature seasonal-season-1 only.
Source§

fn from(v: ScoreCollector) -> StoreObject

Converts to this type from the input type.
Source§

impl From<ScoreContainer> for StoreObject

Available on crate feature seasonal-season-1 only.
Source§

fn from(v: ScoreContainer) -> StoreObject

Converts to this type from the input type.
Source§

impl From<StructureContainer> for StoreObject

Source§

fn from(v: StructureContainer) -> StoreObject

Converts to this type from the input type.
Source§

impl From<StructureExtension> for StoreObject

Source§

fn from(v: StructureExtension) -> StoreObject

Converts to this type from the input type.
Source§

impl From<StructureFactory> for StoreObject

Source§

fn from(v: StructureFactory) -> StoreObject

Converts to this type from the input type.
Source§

impl From<StructureLab> for StoreObject

Source§

fn from(v: StructureLab) -> StoreObject

Converts to this type from the input type.
Source§

impl From<StructureLink> for StoreObject

Source§

fn from(v: StructureLink) -> StoreObject

Converts to this type from the input type.
Source§

impl From<StructureNuker> for StoreObject

Source§

fn from(v: StructureNuker) -> StoreObject

Converts to this type from the input type.
Source§

impl From<StructurePowerSpawn> for StoreObject

Source§

fn from(v: StructurePowerSpawn) -> StoreObject

Converts to this type from the input type.
Source§

impl From<StructureSpawn> for StoreObject

Source§

fn from(v: StructureSpawn) -> StoreObject

Converts to this type from the input type.
Source§

impl From<StructureStorage> for StoreObject

Source§

fn from(v: StructureStorage) -> StoreObject

Converts to this type from the input type.
Source§

impl From<StructureTerminal> for StoreObject

Source§

fn from(v: StructureTerminal) -> StoreObject

Converts to this type from the input type.
Source§

impl From<StructureTower> for StoreObject

Source§

fn from(v: StructureTower) -> StoreObject

Converts to this type from the input type.
Source§

impl From<SymbolContainer> for StoreObject

Available on crate feature seasonal-season-2 only.
Source§

fn from(v: SymbolContainer) -> StoreObject

Converts to this type from the input type.
Source§

impl From<Tombstone> for StoreObject

Source§

fn from(v: Tombstone) -> StoreObject

Converts to this type from the input type.
Source§

impl HasStore for StoreObject

Source§

fn store(&self) -> Store

The store of the object, containing information about the resources it is holding.

Source§

impl TryFrom<StructureObject> for StoreObject

Source§

type Error = StoreObjectConversionError

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

fn try_from(structure: StructureObject) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryInto<Creep> for StoreObject

Source§

type Error = &'static str

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

fn try_into(self) -> Result<Creep, <Self as TryInto<Creep>>::Error>

Performs the conversion.
Source§

impl TryInto<PowerCreep> for StoreObject

Source§

type Error = &'static str

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

fn try_into(self) -> Result<PowerCreep, <Self as TryInto<PowerCreep>>::Error>

Performs the conversion.
Source§

impl TryInto<Reactor> for StoreObject

Available on crate feature seasonal-season-5 only.
Source§

type Error = &'static str

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

fn try_into(self) -> Result<Reactor, <Self as TryInto<Reactor>>::Error>

Performs the conversion.
Source§

impl TryInto<Ruin> for StoreObject

Source§

type Error = &'static str

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

fn try_into(self) -> Result<Ruin, <Self as TryInto<Ruin>>::Error>

Performs the conversion.
Source§

impl TryInto<ScoreCollector> for StoreObject

Available on crate feature seasonal-season-1 only.
Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<ScoreCollector, <Self as TryInto<ScoreCollector>>::Error>

Performs the conversion.
Source§

impl TryInto<ScoreContainer> for StoreObject

Available on crate feature seasonal-season-1 only.
Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<ScoreContainer, <Self as TryInto<ScoreContainer>>::Error>

Performs the conversion.
Source§

impl TryInto<StructureContainer> for StoreObject

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<StructureContainer, <Self as TryInto<StructureContainer>>::Error>

Performs the conversion.
Source§

impl TryInto<StructureExtension> for StoreObject

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<StructureExtension, <Self as TryInto<StructureExtension>>::Error>

Performs the conversion.
Source§

impl TryInto<StructureFactory> for StoreObject

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<StructureFactory, <Self as TryInto<StructureFactory>>::Error>

Performs the conversion.
Source§

impl TryInto<StructureLab> for StoreObject

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<StructureLab, <Self as TryInto<StructureLab>>::Error>

Performs the conversion.
Source§

impl TryInto<StructureLink> for StoreObject

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<StructureLink, <Self as TryInto<StructureLink>>::Error>

Performs the conversion.
Source§

impl TryInto<StructureNuker> for StoreObject

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<StructureNuker, <Self as TryInto<StructureNuker>>::Error>

Performs the conversion.
Source§

impl TryInto<StructurePowerSpawn> for StoreObject

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<StructurePowerSpawn, <Self as TryInto<StructurePowerSpawn>>::Error>

Performs the conversion.
Source§

impl TryInto<StructureSpawn> for StoreObject

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<StructureSpawn, <Self as TryInto<StructureSpawn>>::Error>

Performs the conversion.
Source§

impl TryInto<StructureStorage> for StoreObject

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<StructureStorage, <Self as TryInto<StructureStorage>>::Error>

Performs the conversion.
Source§

impl TryInto<StructureTerminal> for StoreObject

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<StructureTerminal, <Self as TryInto<StructureTerminal>>::Error>

Performs the conversion.
Source§

impl TryInto<StructureTower> for StoreObject

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<StructureTower, <Self as TryInto<StructureTower>>::Error>

Performs the conversion.
Source§

impl TryInto<SymbolContainer> for StoreObject

Available on crate feature seasonal-season-2 only.
Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<SymbolContainer, <Self as TryInto<SymbolContainer>>::Error>

Performs the conversion.
Source§

impl TryInto<Tombstone> for StoreObject

Source§

type Error = &'static str

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

fn try_into(self) -> Result<Tombstone, <Self as TryInto<Tombstone>>::Error>

Performs the conversion.

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.