[][src]Struct twitter_stream::TwitterStreamBuilder

pub struct TwitterStreamBuilder<'a, T = Token> { /* fields omitted */ }

A builder for TwitterStream.

Example

extern crate twitter_stream;

use twitter_stream::{Token, TwitterStreamBuilder};
use twitter_stream::rt::{self, Future, Stream};

let token = Token::new("consumer_key", "consumer_secret", "access_key", "access_secret");

let future = TwitterStreamBuilder::sample(token)
    .timeout(None)
    .listen()
    .unwrap()
    .flatten_stream()
    .for_each(|json| {
        println!("{}", json);
        Ok(())
    })
    .map_err(|e| println!("error: {}", e));

rt::run(future);

Methods

impl<'a, C, A> TwitterStreamBuilder<'a, Token<C, A>> where
    C: Borrow<str>,
    A: Borrow<str>, 
[src]

Create a builder for POST statuses/filter endpoint.

See the Twitter Developer Documentation for more information.

Create a builder for GET statuses/sample endpoint.

See the Twitter Developer Documentation for more information.

Constructs a builder for a Stream at a custom endpoint.

Start listening on the Streaming API endpoint, returning a Future which resolves to a Stream yielding JSON messages from the API.

Same as listen except that it uses client to make HTTP request to the endpoint.

impl<'a, C, A> TwitterStreamBuilder<'a, Token<C, A>>
[src]

Reset the HTTP request method to be used when connecting to the server.

Reset the API endpoint URI to be connected.

Reset the token to be used to log into Twitter.

Set a timeout for the stream. None means infinity.

Set whether to receive messages when in danger of being disconnected.

See the Twitter Developer Documentation for more information.

Set the minimum filter_level Tweet attribute to receive. The default is FilterLevel::None.

See the Twitter Developer Documentation for more information.

Set a comma-separated language identifiers to receive Tweets written in the specified languages only.

See the Twitter Developer Documentation for more information.

Set a list of user IDs to receive Tweets only from the specified users.

See the Twitter Developer Documentation for more information.

A comma separated list of phrases to filter Tweets by.

See the Twitter Developer Documentation for more information.

Set a list of bounding boxes to filter Tweets by, specified by a pair of coordinates in the form of ((longitude, latitude), (longitude, latitude)) tuple.

See the Twitter Developer Documentation for more information.

The count parameter. This parameter requires elevated access to use.

See the Twitter Developer Documentation for more information.

Trait Implementations

impl<'a, T: Clone> Clone for TwitterStreamBuilder<'a, T>
[src]

Performs copy-assignment from source. Read more

impl<'a, T: Debug> Debug for TwitterStreamBuilder<'a, T>
[src]

Auto Trait Implementations

impl<'a, T> Send for TwitterStreamBuilder<'a, T> where
    T: Send

impl<'a, T> Sync for TwitterStreamBuilder<'a, T> where
    T: Sync

Blanket Implementations

impl<T> From for T
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

impl<T> Erased for T

impl<T> Same for T

Should always be Self