[][src]Enum screeps_api::websocket::Channel

pub enum Channel<'a> {
    ServerMessages,
    UserCpu {
        user_id: Cow<'a, str>,
    },
    UserMessages {
        user_id: Cow<'a, str>,
    },
    UserConversation {
        user_id: Cow<'a, str>,
        target_user_id: Cow<'a, str>,
    },
    UserCredits {
        user_id: Cow<'a, str>,
    },
    UserMemoryPath {
        user_id: Cow<'a, str>,
        path: Cow<'a, str>,
    },
    UserConsole {
        user_id: Cow<'a, str>,
    },
    UserActiveBranch {
        user_id: Cow<'a, str>,
    },
    RoomMapView {
        shard_name: Option<Cow<'a, str>>,
        room_name: RoomName,
    },
    RoomDetail {
        shard_name: Option<Cow<'a, str>>,
        room_name: RoomName,
    },
    Other {
        channel: Cow<'a, str>,
    },
}

Different channels one can subscribe to.

Variants

ServerMessages

Server messages (TODO: find message here).

UserCpu

User CPU and memory usage updates. Sent at the end of each tick.

Fields of UserCpu

user_id: Cow<'a, str>

The user ID of the subscription.

UserMessages

User message updates. Sent when the user receives any new message.

Fields of UserMessages

user_id: Cow<'a, str>

The user ID of the subscription.

UserConversation

Specific conversation alerts. Updates when a new message is received from a particular user.

Fields of UserConversation

user_id: Cow<'a, str>

The user ID of the connected user.

target_user_id: Cow<'a, str>

The user ID on the other side of the conversation to listen to.

UserCredits

User credit alerts. Updates whenever the user's credit changes.

Fields of UserCredits

user_id: Cow<'a, str>

The user ID of the subscription.

UserMemoryPath

Memory path alerts. Updates whenever this specific memory path changes.

Fields of UserMemoryPath

user_id: Cow<'a, str>

The user ID of the subscription.

path: Cow<'a, str>

The memory path, separated with '.'.

UserConsole

Console alerts. Updates at the end of every tick with all console messages during that tick.

Fields of UserConsole

user_id: Cow<'a, str>

The user ID of the subscription.

UserActiveBranch

User active branch changes: updates whenever the active branch changes.

Fields of UserActiveBranch

user_id: Cow<'a, str>

The user ID of the subscription.

RoomMapView

Room overview updates. Updates at the end of every tick with all room positions for each nondescript type of structure (road, wall, energy, or player owned).

Fields of RoomMapView

shard_name: Option<Cow<'a, str>>

The shard the room is in, if any.

room_name: RoomName

The room name of the subscription.

RoomDetail

Detailed room updates. Updates at the end of every tick with all room object properties which have changed since the last tick.

Note: this is limited to 2 per user account at a time, and if there are more than 2 room subscriptions active, it is random which 2 will received updates on any given ticks. Rooms which are not updated do receive an error message on "off" ticks.

Fields of RoomDetail

shard_name: Option<Cow<'a, str>>

The shard the room is in, if any.

room_name: RoomName

The room name of the subscription.

Other

A channel specified by the exact channel id.

Fields of Other

channel: Cow<'a, str>

The channel protocol string.

Methods

impl Channel<'static>[src]

pub fn server_messages() -> Self[src]

Creates a channel subscribing to server messages.

pub fn room_map_view_ps(room_name: RoomName) -> Self[src]

Creates a channel subscribing to map-view updates of a room, with no shard.

Warning: creating a channel with a shard name when the server does not have any shards or creating a channel without a shard name on a sharded server will both result in the subscribe silently failing.

pub fn room_detail_ps(room_name: RoomName) -> Self[src]

Creates a channel subscribing to detailed updates of a room's contents, with no shard.

Note: this is limited to 2 per user account at a time, and if there are more than 2 room subscriptions active, it is random which 2 will received updates on any given ticks. Rooms which are not updated do receive an error message on "off" ticks.

Warning: creating a channel with a shard name when the server does not have any shards or creating a channel without a shard name on a sharded server will both result in the subscribe silently failing.

impl<'a> Channel<'a>[src]

pub fn room_map_view<T: Into<Cow<'a, str>>>(
    room_name: RoomName,
    shard_name: Option<T>
) -> Self
[src]

Creates a channel subscribing to map-view updates of a room.

Warning: creating a channel with a shard name when the server does not have any shards or creating a channel without a shard name on a sharded server will both result in the subscribe silently failing.

pub fn room_detail<T: Into<Cow<'a, str>>>(
    room_name: RoomName,
    shard_name: Option<T>
) -> Self
[src]

Creates a channel subscribing to detailed updates of a room's contents.

Warning: creating a channel with a shard name when the server does not have any shards or creating a channel without a shard name on a sharded server will both result in the subscribe silently failing.

Note: this is limited to 2 per user account at a time, and if there are more than 2 room subscriptions active, it is random which 2 will received updates on any given ticks. Rooms which are not updated do receive an error message on "off" ticks.

pub fn user_cpu<T: Into<Cow<'a, str>>>(user_id: T) -> Self[src]

Creates a channel subscribing to a user's CPU and memory.

pub fn user_messages<T: Into<Cow<'a, str>>>(user_id: T) -> Self[src]

Creates a channel subscribing to a user's new message notifications.

pub fn user_conversation<T, U>(user_id: T, target_user_id: U) -> Self where
    T: Into<Cow<'a, str>>,
    U: Into<Cow<'a, str>>, 
[src]

Creates a channel subscribing to new messages in a user's specific conversation.

pub fn user_credits<T: Into<Cow<'a, str>>>(user_id: T) -> Self[src]

Creates a channel subscribing to a user's credit count.

pub fn user_memory_path<T, U>(user_id: T, path: U) -> Self where
    T: Into<Cow<'a, str>>,
    U: Into<Cow<'a, str>>, 
[src]

Creates a channel subscribing to a path in a user's memory.

pub fn user_console<T: Into<Cow<'a, str>>>(user_id: T) -> Self[src]

Creates a channel subscribing to a user's console output.

pub fn user_active_branch<T: Into<Cow<'a, str>>>(user_id: T) -> Self[src]

Creates a channel subscribing to when a user's active code branch changes.

pub fn other<T: Into<Cow<'a, str>>>(channel: T) -> Self[src]

Creates a channel using the fully specified channel name.

Trait Implementations

impl<'a> Display for Channel<'a>[src]

Auto Trait Implementations

impl<'a> Unpin for Channel<'a>

impl<'a> Sync for Channel<'a>

impl<'a> Send for Channel<'a>

impl<'a> RefUnwindSafe for Channel<'a>

impl<'a> UnwindSafe for Channel<'a>

Blanket Implementations

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

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

impl<T> ToString for T where
    T: Display + ?Sized
[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>,