Struct egg_mode::stream::StreamBuilder[][src]

pub struct StreamBuilder { /* fields omitted */ }
Expand description

Represents a TwitterStream before it is started. Use the various methods to build up the filters on your stream.

Bear in mind that the track, follow and locations filters are ORed rather than ANDed together. E.g. if you specify a user id to follow and a phrase to track, you will receive all tweets that match (user id OR phrase), NOT (user id AND phrase). For more details see the official docs

Note: The user must specify at least one track, follow or locations filter or else the stream will fail at point of connection.

Implementations

Filter stream to only return Tweets relating to given user IDs.

Example

use egg_mode::stream::filter;
let stream = filter()
    // View tweets related to BBC news, the Guardian and the New York Times
    .follow(&[612473, 87818409, 807095])
    .start(&token);

Filter stream to only return Tweets containing given phrases.

A phrase may be one or more terms separated by spaces, and a phrase will match if all of the terms in the phrase are present in the Tweet, regardless of order and ignoring case.

Filter stream to only return Tweets that have been detected as being written in the specified languages.

Languages are specified as a list of BCP 47 language identifiers corresponding to any of the languages listed on Twitter’s advanced search page.

Note This library does not validate the language codes.

A list of bounding boxes by which to filter Tweets

Example

use egg_mode::stream::{filter, BoundingBox};
let stream = filter()
    // Only show tweets sent from New York
    .locations(&[BoundingBox::new((-74.0,40.0),(-73.0,41.0))])
    .start(&token);

Applies the given FilterLevel to the stream. Tweets with a filter_level below the given value will not be shown in the stream.

When displaying a stream of Tweets to end users (dashboards or live feeds at a presentation or conference, for example) it is suggested that you set this value to medium.

Finalizes the stream parameters and returns the resulting TwitterStream.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.