[][src]Enum screeps::constants::Terrain

#[repr(u8)]pub enum Terrain {
    Plain,
    Wall,
    Swamp,
}

Terrain constant.

This constant is in a unique position of being represented both by strings and by integers in various parts of the API.

Note: This constant's TryFrom<Value> and Deserialize implementations only work with the integer constants. If you're ever consuming strings such as "plain", "swamp", "wall", you can use the __terrain_str_to_num JavaScript function, FromStr or Terrain::deserialize_from_str.

See the module-level documentation for more details.

Variants

Plain
Wall
Swamp

Implementations

impl Terrain[src]

pub fn deserialize_from_str<'de, D: Deserializer<'de>>(
    d: D
) -> Result<Self, D::Error>
[src]

Helper function for deserializing from a string rather than from an integer.

Trait Implementations

impl Clone for Terrain[src]

impl Copy for Terrain[src]

impl Debug for Terrain[src]

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

impl Eq for Terrain[src]

impl FromPrimitive for Terrain[src]

impl FromStr for Terrain[src]

type Err = ParseError

The associated error which can be returned from parsing.

impl Hash for Terrain[src]

impl PartialEq<Terrain> for Terrain[src]

impl Serialize for Terrain[src]

impl StructuralEq for Terrain[src]

impl StructuralPartialEq for Terrain[src]

impl TryFrom<Value> for Terrain[src]

type Error = ConversionError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Terrain

impl Send for Terrain

impl Sync for Terrain

impl Unpin for Terrain

impl UnwindSafe for Terrain

Blanket Implementations

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

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

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

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

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

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

impl<T, U> IntoExpectedType<U> for T where
    U: FromExpectedType<T>, 
[src]

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

type Owned = T

The resulting type after obtaining ownership.

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, 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.