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

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

Server messages (TODO: find message here).

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

Fields of UserCpu

The user ID of the subscription.

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

Fields of UserMessages

The user ID of the subscription.

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

Fields of UserConversation

The user ID of the connected user.

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

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

Fields of UserCredits

The user ID of the subscription.

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

Fields of UserMemoryPath

The user ID of the subscription.

The memory path, separated with '.'.

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

Fields of UserConsole

The user ID of the subscription.

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

Fields of UserActiveBranch

The user ID of the subscription.

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

The shard the room is in, if any.

The room name of the subscription.

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

The shard the room is in, if any.

The room name of the subscription.

A channel specified by the exact channel id.

Fields of Other

The channel protocol string.

Methods

impl Channel<'static>
[src]

[src]

Creates a channel subscribing to server messages.

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

[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]

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

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

Creates a channel using the fully specified channel name.

Trait Implementations

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

[src]

Formats the value using the given formatter. Read more