Trait screeps::traits::IntoExpectedType[][src]

pub trait IntoExpectedType<T> {
    fn into_expected_type(self) -> Result<T, ConversionError>;
}

Trait for casting api results which we expect to be the right thing as long as all JS code is behaving as expected.

This trait allows us to switch between checked and unchecked casts at compile time with the "check-all-casts" feature flag.

Required methods

fn into_expected_type(self) -> Result<T, ConversionError>[src]

Casts this value as the target type, making the assumption that the types are correct.

Error conditions

If the types don't match up, and "check-all-casts" is enabled, this will return an error.

If this is a non-Reference Value, this will return an error.

Loading content...

Implementors

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

Loading content...