[][src]Enum screeps_api::websocket::ScreepsMessage

pub enum ScreepsMessage<'a> {
    AuthFailed,
    AuthOk {
        new_token: Token,
    },
    ServerTime {
        time: u64,
    },
    ServerProtocol {
        protocol: u32,
    },
    ServerPackage {
        package: u32,
    },
    ChannelUpdate {
        update: ChannelUpdate<'a>,
    },
    Other(Cow<'a, str>),
}

A parsed message.

Variants

AuthFailed

Authentication failed.

AuthOk

Authentication successful!

Fields of AuthOk

new_token: Token

The new token to store.

ServerTime

On initial connection, the server reports its own time.

Fields of ServerTime

time: u64

The server time.

ServerProtocol

On initial connection, the server reports a protocol version.

Fields of ServerProtocol

protocol: u32

The protocol version.

ServerPackage

On initial connection, the server reports a "package" number.

Fields of ServerPackage

package: u32

I'm not sure what this means at all.

ChannelUpdate

An update on one of the channels.

Fields of ChannelUpdate

update: ChannelUpdate<'a>

The update.

Other(Cow<'a, str>)

Another kind of message.

Methods

impl ScreepsMessage<'static>[src]

pub fn parse<T: AsRef<str> + ?Sized>(message: &T) -> Self[src]

Parses the internal message from a SockJS message into a meaningful type.

Trait Implementations

impl<'a> Clone for ScreepsMessage<'a>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a> Debug for ScreepsMessage<'a>[src]

Auto Trait Implementations

impl<'a> Unpin for ScreepsMessage<'a>

impl<'a> Sync for ScreepsMessage<'a>

impl<'a> Send for ScreepsMessage<'a>

impl<'a> RefUnwindSafe for ScreepsMessage<'a>

impl<'a> UnwindSafe for ScreepsMessage<'a>

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> Erased for T

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