[−][src]Enum screeps_api::RoomState
A room state, returned by room status.
Note that the API itself will return timestamps for "novice end" and "open time" even when the room is no longer novice, so the current system's knowledge of utc time is used to determine whether a room is novice or not.
Variants
Nonexistant
Room name does not exist.
Closed
Room exists and terrain has been generated, but room is completely closed.
Open
Room exists, is open, and is not part of a novice area.
Novice
Room is part of a novice area.
Fields of Novice
end_time: Timespec
The time when the novice area will expire.
SecondTierNovice
Room is part of a "second tier" novice area, which is closed, but when opened will be part of a novice area which already has other open rooms.
Fields of SecondTierNovice
Methods
impl RoomState
[src]
pub fn from_data(
current_time: Timespec,
novice_end: Option<Timespec>,
open_time: Option<Timespec>
) -> Result<Self, ApiError>
[src]
current_time: Timespec,
novice_end: Option<Timespec>,
open_time: Option<Timespec>
) -> Result<Self, ApiError>
Constructs a RoomState based off of the result from the API, and the current system time.
Note that the system time is used to determine whether the room is novice or second tier novice, because the API will only return the time that the novice area ends, and not if it is currently novice.
This is mainly for use from within other API result structures, and should never need to be used by an external user of the library.
novice_end
is generally named novice
in API results, open_time
is openTime
. Respectively, they mean the
time at which the novice area at this room ends/ended, and the time at which this room opens/opened into a
larger novice area from being completely inaccessible.
pub fn non_existant() -> Self
[src]
Creates a non-existant room state.
pub fn closed() -> Self
[src]
Creates a "closed" room state.
TODO: find what the server actually responds with for these rooms so we can find how to interpret them.
Trait Implementations
impl PartialEq<RoomState> for RoomState
[src]
impl Clone for RoomState
[src]
fn clone(&self) -> RoomState
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for RoomState
[src]
impl Eq for RoomState
[src]
impl Hash for RoomState
[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 Debug for RoomState
[src]
impl Serialize for RoomState
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for RoomState
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Unpin for RoomState
impl Send for RoomState
impl Sync for RoomState
impl UnwindSafe for RoomState
impl RefUnwindSafe for RoomState
Blanket Implementations
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> From<T> for T
[src]
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> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Erased for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,