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§
Provided Methods§
sourcefn id(&self) -> ObjectId<Self>where
Self: Sized,
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.
sourcefn raw_id(&self) -> RawObjectId
fn raw_id(&self) -> RawObjectId
Object ID of the object stored in Rust memory, without its associated type information.
sourcefn js_id(&self) -> JsObjectId<Self>where
Self: Sized,
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§
impl HasId for Deposit
impl HasId for Mineral
impl HasId for Nuke
impl HasId for PowerCreep
impl HasId for Reactor
Available on crate feature
seasonal-season-5
only.impl HasId for Resource
impl HasId for Ruin
impl HasId for ScoreCollector
Available on crate feature
seasonal-season-1
only.impl HasId for ScoreContainer
Available on crate feature
seasonal-season-1
only.impl HasId for Source
impl HasId for SymbolContainer
Available on crate feature
seasonal-season-2
only.impl HasId for SymbolDecoder
Available on crate feature
seasonal-season-2
only.