[][src]Enum egg_mode::stream::StreamMessage

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(u64String),
    Unknown(Value),
}

Represents the kinds of messages that can be sent over Twitter's Streaming API.

Variants

Ping

A blank line, sent periodically to keep the connection alive.

FriendList(Vec<u64>)

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.

Delete

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

Fields of Delete

status_id: u64

The status that was deleted.

user_id: u64

The user that deleted the status.

ScrubGeo

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

Fields of ScrubGeo

user_id: u64

The user whose geolocation information needs to be scrubbed.

up_to_status_id: u64

The last status ID to scrub information from.

StatusWithheld

Placeholder message used to indicate that a specific tweet has been withheld in certain countries.

Fields of StatusWithheld

status_id: u64

The status that was withheld.

user_id: u64

The user that posted the status.

withheld_in_countries: Vec<String>

A list of uppercase two-character country codes listing the countries where the tweet was withheld.

UserWithheld

Placeholder message used to indicate that a specific user's content has been withheld in certain countries.

Fields of UserWithheld

user_id: u64

The user whose content was withheld.

withheld_in_countries: Vec<String>

A list of uppercase two-character country codes listing the countries where the content was withheld.

Disconnect(u64String)

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

impl Debug for StreamMessage[src]

impl<'de> Deserialize<'de> for StreamMessage[src]

impl FromStr for StreamMessage[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,