Enum egg_mode::stream::StreamMessage [−][src]
pub enum StreamMessage {
Ping,
FriendList(Vec<u64>),
Tweet(Tweet),
Delete {
status_id: u64,
user_id: u64,
},
ScrubGeo {
user_id: u64,
up_to_status_id: u64,
},
StatusWithheld {
status_id: u64,
user_id: u64,
withheld_in_countries: Vec<String>,
},
UserWithheld {
user_id: u64,
withheld_in_countries: Vec<String>,
},
Disconnect(u64, String),
Unknown(Value),
}Expand description
Represents the kinds of messages that can be sent over Twitter’s Streaming API.
Variants
A blank line, sent periodically to keep the connection alive.
A list of accounts the authenticated user follows, sent at the beginning of the session for user streams.
Tweet(Tweet)A new tweet.
Note that the entities inside the user field will be empty for tweets received via the
Streaming API.
Notice given when a user deletes a post.
Clients are expected to comply with these notices by removing the status “from memory and any storage or archive, even in the rare case where a deletion message arrives earlier in the stream than the Tweet it references.”
Show fields
Notice given when a user removes geolocation information from their profile.
Clients are expected to comply by deleting cached geolocation information from tweets by the given user, for any tweets up to and including the given status ID. According to Twitter’s documentation, “These messages may also arrive before a Tweet which falls into the specified range, although this is rare.”
Show fields
Placeholder message used to indicate that a specific tweet has been withheld in certain countries.
Show fields
Placeholder message used to indicate that a specific user’s content has been withheld in certain countries.
Show fields
An error message that may be delivered immediately prior to Twitter disconnecting the stream.
Note that if the stream is disconnected due to network issues or the client reading messages too slowly, it’s possible that this message may not be received.
The enclosed values are an error code and error description. A non-exhaustive list of error codes and their associated reasons are available on Twitter’s stream docmentation, under “Disconnect messages (disconnect)”.
Unknown(Value)An unhandled message payload.
Twitter can add new streaming messages to the API, and egg-mode includes them here so that they can be used before egg-mode has a chance to handle them.
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for StreamMessageimpl Send for StreamMessageimpl Sync for StreamMessageimpl Unpin for StreamMessageimpl UnwindSafe for StreamMessage