Struct screeps::LocalRoomName
source · Expand description
A structure representing a room name.
Fields
x_coord: i32
Inner x coordinate representation.
0 represents E0, positive numbers represent E(x)
-1 represents W0, negative numbers represent W((-x) - 1)
y_coord: i32
Inner y coordinate representation.
0 represents N0, positive numbers represent N(y)
-1 represents S0, negative numbers represent S((-y) - 1)
Implementations
Trait Implementations
sourceimpl Add<(i32, i32)> for LocalRoomName
impl Add<(i32, i32)> for LocalRoomName
sourceimpl Clone for LocalRoomName
impl Clone for LocalRoomName
sourcefn clone(&self) -> LocalRoomName
fn clone(&self) -> LocalRoomName
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for LocalRoomName
impl Debug for LocalRoomName
sourceimpl<'de> Deserialize<'de> for LocalRoomName
impl<'de> Deserialize<'de> for LocalRoomName
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for LocalRoomName
impl Display for LocalRoomName
sourcefn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats this room name into the format the game expects.
Resulting string will be (E|W)[0-9]+(N|S)[0-9]+
, and will result
in the same LocalRoomName if passed into LocalRoomName::new
.
sourceimpl Hash for LocalRoomName
impl Hash for LocalRoomName
sourceimpl PartialEq<LocalRoomName> for LocalRoomName
impl PartialEq<LocalRoomName> for LocalRoomName
sourcefn eq(&self, other: &LocalRoomName) -> bool
fn eq(&self, other: &LocalRoomName) -> bool
sourceimpl Serialize for LocalRoomName
impl Serialize for LocalRoomName
sourceimpl Sub<(i32, i32)> for LocalRoomName
impl Sub<(i32, i32)> for LocalRoomName
sourceimpl Sub<LocalRoomName> for LocalRoomName
impl Sub<LocalRoomName> for LocalRoomName
sourceimpl<'_a> TryFrom<&'_a LocalRoomName> for Value
impl<'_a> TryFrom<&'_a LocalRoomName> for Value
type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
sourcefn try_from(value: &'_a LocalRoomName) -> Result<Self, Self::Error>
fn try_from(value: &'_a LocalRoomName) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl<'_a> TryFrom<&'_a mut LocalRoomName> for Value
impl<'_a> TryFrom<&'_a mut LocalRoomName> for Value
type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
sourcefn try_from(value: &'_a mut LocalRoomName) -> Result<Self, Self::Error>
fn try_from(value: &'_a mut LocalRoomName) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<LocalRoomName> for Value
impl TryFrom<LocalRoomName> for Value
type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
sourcefn try_from(value: LocalRoomName) -> Result<Self, Self::Error>
fn try_from(value: LocalRoomName) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<Value> for LocalRoomName
impl TryFrom<Value> for LocalRoomName
impl Copy for LocalRoomName
impl Eq for LocalRoomName
impl JsSerialize for LocalRoomName
impl StructuralEq for LocalRoomName
impl StructuralPartialEq for LocalRoomName
Auto Trait Implementations
impl RefUnwindSafe for LocalRoomName
impl Send for LocalRoomName
impl Sync for LocalRoomName
impl Unpin for LocalRoomName
impl UnwindSafe for LocalRoomName
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, U> IntoExpectedType<U> for Twhere
U: FromExpectedType<T>,
impl<T, U> IntoExpectedType<U> for Twhere
U: FromExpectedType<T>,
sourcefn into_expected_type(self) -> Result<U, ConversionError>
fn into_expected_type(self) -> Result<U, ConversionError>
Casts this value as the target type, making the assumption that the types are correct. Read more