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)
StructureLink(StructureLink)
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
impl StoreObject
Sourcepub const fn resource_types(&self) -> &'static [ResourceType]
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
impl From<Creep> for StoreObject
Source§fn from(v: Creep) -> StoreObject
fn from(v: Creep) -> StoreObject
Converts to this type from the input type.
Source§impl From<PowerCreep> for StoreObject
impl From<PowerCreep> for StoreObject
Source§fn from(v: PowerCreep) -> StoreObject
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.
impl From<Reactor> for StoreObject
Available on crate feature
seasonal-season-5 only.Source§fn from(v: Reactor) -> StoreObject
fn from(v: Reactor) -> StoreObject
Converts to this type from the input type.
Source§impl From<Ruin> for StoreObject
impl From<Ruin> for StoreObject
Source§fn from(v: Ruin) -> StoreObject
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.
impl From<ScoreCollector> for StoreObject
Available on crate feature
seasonal-season-1 only.Source§fn from(v: ScoreCollector) -> StoreObject
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.
impl From<ScoreContainer> for StoreObject
Available on crate feature
seasonal-season-1 only.Source§fn from(v: ScoreContainer) -> StoreObject
fn from(v: ScoreContainer) -> StoreObject
Converts to this type from the input type.
Source§impl From<StructureContainer> for StoreObject
impl From<StructureContainer> for StoreObject
Source§fn from(v: StructureContainer) -> StoreObject
fn from(v: StructureContainer) -> StoreObject
Converts to this type from the input type.
Source§impl From<StructureExtension> for StoreObject
impl From<StructureExtension> for StoreObject
Source§fn from(v: StructureExtension) -> StoreObject
fn from(v: StructureExtension) -> StoreObject
Converts to this type from the input type.
Source§impl From<StructureFactory> for StoreObject
impl From<StructureFactory> for StoreObject
Source§fn from(v: StructureFactory) -> StoreObject
fn from(v: StructureFactory) -> StoreObject
Converts to this type from the input type.
Source§impl From<StructureLab> for StoreObject
impl From<StructureLab> for StoreObject
Source§fn from(v: StructureLab) -> StoreObject
fn from(v: StructureLab) -> StoreObject
Converts to this type from the input type.
Source§impl From<StructureLink> for StoreObject
impl From<StructureLink> for StoreObject
Source§fn from(v: StructureLink) -> StoreObject
fn from(v: StructureLink) -> StoreObject
Converts to this type from the input type.
Source§impl From<StructureNuker> for StoreObject
impl From<StructureNuker> for StoreObject
Source§fn from(v: StructureNuker) -> StoreObject
fn from(v: StructureNuker) -> StoreObject
Converts to this type from the input type.
Source§impl From<StructurePowerSpawn> for StoreObject
impl From<StructurePowerSpawn> for StoreObject
Source§fn from(v: StructurePowerSpawn) -> StoreObject
fn from(v: StructurePowerSpawn) -> StoreObject
Converts to this type from the input type.
Source§impl From<StructureSpawn> for StoreObject
impl From<StructureSpawn> for StoreObject
Source§fn from(v: StructureSpawn) -> StoreObject
fn from(v: StructureSpawn) -> StoreObject
Converts to this type from the input type.
Source§impl From<StructureStorage> for StoreObject
impl From<StructureStorage> for StoreObject
Source§fn from(v: StructureStorage) -> StoreObject
fn from(v: StructureStorage) -> StoreObject
Converts to this type from the input type.
Source§impl From<StructureTerminal> for StoreObject
impl From<StructureTerminal> for StoreObject
Source§fn from(v: StructureTerminal) -> StoreObject
fn from(v: StructureTerminal) -> StoreObject
Converts to this type from the input type.
Source§impl From<StructureTower> for StoreObject
impl From<StructureTower> for StoreObject
Source§fn from(v: StructureTower) -> StoreObject
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.
impl From<SymbolContainer> for StoreObject
Available on crate feature
seasonal-season-2 only.Source§fn from(v: SymbolContainer) -> StoreObject
fn from(v: SymbolContainer) -> StoreObject
Converts to this type from the input type.
Source§impl From<Tombstone> for StoreObject
impl From<Tombstone> for StoreObject
Source§fn from(v: Tombstone) -> StoreObject
fn from(v: Tombstone) -> StoreObject
Converts to this type from the input type.
Source§impl HasStore for StoreObject
impl HasStore for StoreObject
Source§impl TryFrom<StructureObject> for StoreObject
impl TryFrom<StructureObject> for StoreObject
Source§type Error = StoreObjectConversionError
type Error = StoreObjectConversionError
The type returned in the event of a conversion error.
Source§impl TryInto<Creep> for StoreObject
impl TryInto<Creep> for StoreObject
Source§impl TryInto<PowerCreep> for StoreObject
impl TryInto<PowerCreep> for StoreObject
Source§impl TryInto<Reactor> for StoreObject
Available on crate feature seasonal-season-5 only.
impl TryInto<Reactor> for StoreObject
Available on crate feature
seasonal-season-5 only.Source§impl TryInto<Ruin> for StoreObject
impl TryInto<Ruin> for StoreObject
Source§impl TryInto<ScoreCollector> for StoreObject
Available on crate feature seasonal-season-1 only.
impl TryInto<ScoreCollector> for StoreObject
Available on crate feature
seasonal-season-1 only.Source§impl TryInto<ScoreContainer> for StoreObject
Available on crate feature seasonal-season-1 only.
impl TryInto<ScoreContainer> for StoreObject
Available on crate feature
seasonal-season-1 only.Source§impl TryInto<StructureContainer> for StoreObject
impl TryInto<StructureContainer> for StoreObject
Source§impl TryInto<StructureExtension> for StoreObject
impl TryInto<StructureExtension> for StoreObject
Source§impl TryInto<StructureFactory> for StoreObject
impl TryInto<StructureFactory> for StoreObject
Source§impl TryInto<StructureLab> for StoreObject
impl TryInto<StructureLab> for StoreObject
Source§impl TryInto<StructureLink> for StoreObject
impl TryInto<StructureLink> for StoreObject
Source§impl TryInto<StructureNuker> for StoreObject
impl TryInto<StructureNuker> for StoreObject
Source§impl TryInto<StructurePowerSpawn> for StoreObject
impl TryInto<StructurePowerSpawn> for StoreObject
Source§impl TryInto<StructureSpawn> for StoreObject
impl TryInto<StructureSpawn> for StoreObject
Source§impl TryInto<StructureStorage> for StoreObject
impl TryInto<StructureStorage> for StoreObject
Source§impl TryInto<StructureTerminal> for StoreObject
impl TryInto<StructureTerminal> for StoreObject
Source§impl TryInto<StructureTower> for StoreObject
impl TryInto<StructureTower> for StoreObject
Source§impl TryInto<SymbolContainer> for StoreObject
Available on crate feature seasonal-season-2 only.
impl TryInto<SymbolContainer> for StoreObject
Available on crate feature
seasonal-season-2 only.Auto Trait Implementations§
impl Freeze for StoreObject
impl RefUnwindSafe for StoreObject
impl Send for StoreObject
impl Sync for StoreObject
impl Unpin for StoreObject
impl UnsafeUnpin for StoreObject
impl UnwindSafe for StoreObject
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