Trait screeps::traits::HasId

source ·
pub trait HasId: MaybeHasId {
    // Required method
    fn js_raw_id(&self) -> JsString;

    // Provided methods
    fn id(&self) -> ObjectId<Self>
       where Self: Sized { ... }
    fn raw_id(&self) -> RawObjectId { ... }
    fn js_id(&self) -> JsObjectId<Self>
       where Self: Sized { ... }
}
Expand description

Trait for all game objects which have an associated unique identifier.

Required Methods§

source

fn js_raw_id(&self) -> JsString

Object ID of the object stored in JavaScript memory, without its associated type information.

Provided Methods§

source

fn id(&self) -> ObjectId<Self>
where Self: Sized,

Object ID of the object stored in Rust memory, which can be used to efficiently fetch a fresh reference to the object on subsequent ticks.

source

fn raw_id(&self) -> RawObjectId

Object ID of the object stored in Rust memory, without its associated type information.

source

fn js_id(&self) -> JsObjectId<Self>
where Self: Sized,

Object ID of the object stored in JavaScript memory, which can be used to efficiently fetch a fresh reference to the object on subsequent ticks.

Implementors§

source§

impl HasId for Deposit

source§

impl HasId for Mineral

source§

impl HasId for Nuke

source§

impl HasId for PowerCreep

source§

impl HasId for Reactor

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

impl HasId for Resource

source§

impl HasId for Ruin

source§

impl HasId for ScoreCollector

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

impl HasId for ScoreContainer

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

impl HasId for Source

source§

impl HasId for SymbolContainer

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

impl HasId for SymbolDecoder

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

impl HasId for Tombstone

source§

impl<T> HasId for T
where T: AsRef<Structure> + JsCast,