[−][src]Struct screeps::LocalRoomName
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)
Methods
impl LocalRoomName
[src]
pub fn new<T: ?Sized>(x: &T) -> Result<Self, LocalRoomNameParseError> where
T: AsRef<str>,
[src]
T: AsRef<str>,
Creates a new room name from the given input.
This will parse the input, and return an error if it is in an invalid format.
pub fn from_coords(east: bool, north: bool, x_pos: i32, y_pos: i32) -> Self
[src]
Creates a new room name from the given position parameters.
Trait Implementations
impl PartialEq<LocalRoomName> for LocalRoomName
[src]
fn eq(&self, other: &LocalRoomName) -> bool
[src]
fn ne(&self, other: &LocalRoomName) -> bool
[src]
impl<'_> PartialEq<&'_ str> for LocalRoomName
[src]
fn eq(&self, other: &&str) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'_> PartialEq<LocalRoomName> for &'_ str
[src]
fn eq(&self, other: &LocalRoomName) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<String> for LocalRoomName
[src]
fn eq(&self, other: &String) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<LocalRoomName> for String
[src]
fn eq(&self, other: &LocalRoomName) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'_> PartialEq<&'_ String> for LocalRoomName
[src]
fn eq(&self, other: &&String) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'_> PartialEq<LocalRoomName> for &'_ String
[src]
fn eq(&self, other: &LocalRoomName) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Clone for LocalRoomName
[src]
fn clone(&self) -> LocalRoomName
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for LocalRoomName
[src]
impl Copy for LocalRoomName
[src]
impl Display for LocalRoomName
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
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
.
impl Debug for LocalRoomName
[src]
impl Add<(i32, i32)> for LocalRoomName
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, (x, y): (i32, i32)) -> Self
[src]
Adds an (x, y) coordinate pair to this room name.
impl Sub<(i32, i32)> for LocalRoomName
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, (x, y): (i32, i32)) -> Self
[src]
Subtracts an (x, y) coordinate pair to this room name.
impl Sub<LocalRoomName> for LocalRoomName
[src]
type Output = (i32, i32)
The resulting type after applying the -
operator.
fn sub(self, other: LocalRoomName) -> (i32, i32)
[src]
Subtracts an (x, y) coordinate pair to this room name.
impl Hash for LocalRoomName
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl TryFrom<Value> for LocalRoomName
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Self, Self::Error>
impl TryFrom<LocalRoomName> for Value
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: LocalRoomName) -> Result<Self, Self::Error>
impl<'_a> TryFrom<&'_a LocalRoomName> for Value
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: &'_a LocalRoomName) -> Result<Self, Self::Error>
impl<'_a> TryFrom<&'_a mut LocalRoomName> for Value
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: &'_a mut LocalRoomName) -> Result<Self, Self::Error>
impl JsSerialize for LocalRoomName
fn _into_js<'x>(&'x self) -> SerializedValue<'x>
impl JsSerializeOwned for LocalRoomName
fn into_js_owned<'_a>(value: &'_a mut Option<Self>) -> SerializedValue<'_a>
impl<'_r> JsSerializeOwned for &'_r LocalRoomName
fn into_js_owned<'_a>(value: &'_a mut Option<Self>) -> SerializedValue<'_a>
impl Serialize for LocalRoomName
[src]
impl<'de> Deserialize<'de> for LocalRoomName
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Auto Trait Implementations
impl Unpin for LocalRoomName
impl Sync for LocalRoomName
impl Send for LocalRoomName
impl RefUnwindSafe for LocalRoomName
impl UnwindSafe for LocalRoomName
Blanket Implementations
impl<T, U> IntoExpectedType<U> for T where
U: FromExpectedType<T>,
[src]
U: FromExpectedType<T>,
fn into_expected_type(Self) -> Result<U, ConversionError>
[src]
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,