[][src]Enum screeps_api::RoomState

pub enum RoomState {
    Nonexistant,
    Closed,
    Open,
    Novice {
        end_time: Timespec,
    },
    SecondTierNovice {
        room_open_time: Timespec,
        end_time: Timespec,
    },
}

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

room_open_time: Timespec

The time this room will open and join the surrounding novice area rooms.

end_time: Timespec

The time the novice area this room is a part of will expire.

Methods

impl RoomState[src]

pub fn from_data(
    current_time: Timespec,
    novice_end: Option<Timespec>,
    open_time: Option<Timespec>
) -> Result<Self, ApiError>
[src]

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_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Eq for RoomState[src]

impl Copy for RoomState[src]

impl Debug for RoomState[src]

impl Hash for RoomState[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Serialize for RoomState[src]

impl<'de> Deserialize<'de> for RoomState[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,