[−][src]Struct screeps::LocalRoomName
A structure representing a room name.
Fields
x_coord: i32Inner x coordinate representation.
0 represents E0, positive numbers represent E(x)
-1 represents W0, negative numbers represent W((-x) - 1)
y_coord: i32Inner 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 Eq for LocalRoomName[src]
impl Copy for LocalRoomName[src]
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 PartialEq<LocalRoomName> for LocalRoomName[src]
fn eq(&self, other: &LocalRoomName) -> bool[src]
fn ne(&self, other: &LocalRoomName) -> bool[src]
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 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 Debug 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 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>,
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>
Auto Trait Implementations
impl Send for LocalRoomName
impl Sync for LocalRoomName
Blanket Implementations
impl<T, U> IntoExpectedType for T where
U: FromExpectedType<T>, [src]
U: FromExpectedType<T>,
fn into_expected_type(Self) -> Result<U, ConversionError>[src]
impl<T> From for T[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = !
try_from)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> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from)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>,
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,