pub struct MemoryReference(_);
Expand description

A Reference to a screeps memory object

Implementations

Creates a MemoryReference from some JavaScript reference.

Warning: MemoryReference is only designed to work with “plain” JavaScript objects, and passing an array or a non-plain object into this method probably won’t be what you want. MemoryReference also gives access to all properties, so if this is indeed a plain object, all of its values should also be plain objects.

Passing a non-plain-object reference into this function won’t invoke undefined behavior in and of itself, but other functions can rely on MemoryReference being “plain”.

Get a dictionary value or create it if it does not exist.

If the value exists but is a different type, this will return None.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.
Returns the “default value” for a type. Read more
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Casts this value as the target type, making the assumption that the types are correct. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.