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
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]
fn server_messages() -> Self
[src]
Creates a channel subscribing to server messages.
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.
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]
fn room_map_view<T: Into<Cow<'a, str>>>(
room_name: RoomName,
shard_name: Option<T>
) -> Self
[src]
room_name: RoomName,
shard_name: Option<T>
) -> Self
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.
fn room_detail<T: Into<Cow<'a, str>>>(
room_name: RoomName,
shard_name: Option<T>
) -> Self
[src]
room_name: RoomName,
shard_name: Option<T>
) -> Self
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.
fn user_cpu<T: Into<Cow<'a, str>>>(user_id: T) -> Self
[src]
Creates a channel subscribing to a user's CPU and memory.
fn user_messages<T: Into<Cow<'a, str>>>(user_id: T) -> Self
[src]
Creates a channel subscribing to a user's new message notifications.
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]
T: Into<Cow<'a, str>>,
U: Into<Cow<'a, str>>,
Creates a channel subscribing to new messages in a user's specific conversation.
fn user_credits<T: Into<Cow<'a, str>>>(user_id: T) -> Self
[src]
Creates a channel subscribing to a user's credit count.
fn user_memory_path<T, U>(user_id: T, path: U) -> Self where
T: Into<Cow<'a, str>>,
U: Into<Cow<'a, str>>,
[src]
T: Into<Cow<'a, str>>,
U: Into<Cow<'a, str>>,
Creates a channel subscribing to a path in a user's memory.
fn user_console<T: Into<Cow<'a, str>>>(user_id: T) -> Self
[src]
Creates a channel subscribing to a user's console output.
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.
fn other<T: Into<Cow<'a, str>>>(channel: T) -> Self
[src]
Creates a channel using the fully specified channel name.