[−][src]Enum screeps_api::websocket::ChannelUpdate
An update to a Screeps server 'channel' that has been subscribed to.
Variants
RoomMapView
A 'map view' update of a room. Sent once per tick.
Fields of RoomMapView
room_name: RoomName
The name of the room this is an update for.
shard_name: Option<String>
The shard the room is in, if any.
update: RoomMapViewUpdate
The data: the positions and nondescript types of entities in this room.
RoomDetail
An update of objects in a room. Sent once per tick for up to 2 rooms per account.
Other subscribed rooms receive ChannelUpdate::NoRoomDetail
instead.
Fields of RoomDetail
room_name: RoomName
The name of the room this is an update for.
shard_name: Option<String>
The shard the room is in, if any.
update: RoomUpdate
The data: all properties of all objects in this room that have changed since the last tick.
NoRoomDetail
An update/error received for room detail subscriptions which will not receive an update this tick.
This is due to screeps having a 2-room subscription limit. If more are subscribed globally (per-account, not per-connection) then only 2 receive actual updates.
TODO: This should have a better name, and possibly be incorporated into ChannelUpdate::RoomDetail
.
Fields of NoRoomDetail
UserCpu
An update on the last tick's CPU and memory usage. Sent once per tick.
Fields of UserCpu
UserConsole
An update on all user script log messages last tick or a specific error message. Sent once and exactly once per tick unless:
- Multiple script errors occurred.
- Normal log messages were sent and a script error also occurred.
In either of these cases, two or more of these updates will occur in short succession.
Fields of UserConsole
UserCredits
An update on the user's credit total at the end of the last tick. Sent once per tick.
Fields of UserCredits
UserMessage
An update on a new message received by a user. Sent each time a user receives a message.
Fields of UserMessage
user_id: Cow<'a, str>
The user ID this message update is for.
update: MessageUpdate
The message update.
UserConversation
An update on a change in a conversation the user is participating in. Sent each time either this user or the user or the respondent either sends a message, or reads a previously unread message.
Fields of UserConversation
user_id: Cow<'a, str>
The user ID of the subscribed user this update is for.
target_user_id: Cow<'a, str>
The user ID of the other user in the conversation.
update: ConversationUpdate
The message update.
Other
Another update that was not accounted for.
TODO: when we're sure of everything, remove this variant.
Fields of Other
Methods
impl<'a> ChannelUpdate<'a>
[src]
pub fn shard_name(&self) -> Option<&str>
[src]
If this update is directly associated with a room, gets the room name.
pub fn room_name(&self) -> Option<&RoomName>
[src]
If this update is directly associated with a room, gets the room name.
pub fn user_id(&self) -> Option<&str>
[src]
If this update is directly associated with a subscribed user id, gets the user id.
The user_id is always the user id of the subscribed user, never another associated id.
For example, with 'message' updates, this is the user ID of the user receiving the notification, not the user id of the sender.
pub fn channel(&self) -> Channel
[src]
Gets the channel which this update is from.
This channel specification can be used to subscribe or unsubscribe from this channel if needed.
Trait Implementations
impl<'a> Clone for ChannelUpdate<'a>
[src]
fn clone(&self) -> ChannelUpdate<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> Debug for ChannelUpdate<'a>
[src]
impl<'de> Deserialize<'de> for ChannelUpdate<'static>
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Auto Trait Implementations
impl<'a> Unpin for ChannelUpdate<'a>
impl<'a> Send for ChannelUpdate<'a>
impl<'a> Sync for ChannelUpdate<'a>
impl<'a> UnwindSafe for ChannelUpdate<'a>
impl<'a> RefUnwindSafe for ChannelUpdate<'a>
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Erased for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,