Struct twitter_stream::TwitterStreamBuilder [] [src]

pub struct TwitterStreamBuilder<'a, CH: 'a> { /* fields omitted */ }

A builder for TwitterStream.

Example

extern crate futures;
extern crate tokio_core;
extern crate twitter_stream;

use futures::{Future, Stream};
use tokio_core::reactor::Core;
use twitter_stream::{Token, TwitterStreamBuilder};

let token = Token::new("consumer_key", "consumer_secret", "access_key", "access_secret");
let mut core = Core::new().unwrap();
let handle = core.handle();

let future = TwitterStreamBuilder::user(&token)
    .handle(&handle)
    .timeout(None)
    .replies(true)
    .listen() // You cannot call `listen` method before you call `client` or `handle` method.
    .flatten_stream()
    .for_each(|json| {
        println!("{}", json);
        Ok(())
    });

core.run(future).unwrap();

Methods

impl<'a> TwitterStreamBuilder<'a, ()>
[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.

Create a builder for GET user endpoint (a.k.a. User Stream).

See the Twitter Developer Documentation for more information.

Constructs a builder for a Stream at a custom end point.

impl<'a, CH> TwitterStreamBuilder<'a, CH>
[src]

Set a hyper::Client to be used for connecting to the server.

The Client should be able to handle the https scheme.

This method overrides the effect of handle method.

Set a tokio_core::reactor::Handle to be used for connecting to the server.

This method overrides the effect of client method.

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

Reset the API endpoint URL to be connected.

Reset the token to be used to log into Twitter.

Set a user agent string to be sent when connectiong to the Stream.

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][1] for more information. [1] https://dev.twitter.com/streaming/overview/request-parameters#follow

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.

Set types of messages delivered to User and Site Streams clients.

Set whether to receive all @replies.

See the Twitter Developer Documentation for more information.

impl<'a, C, B> TwitterStreamBuilder<'a, Client<C, B>> where
    C: Connect,
    B: From<Vec<u8>> + Stream<Error = HyperError> + 'static,
    B::Item: AsRef<[u8]>, 
[src]

Attempt to start listening on a Stream and returns a Stream object which yields parsed messages from the API.

You need to call client method before trying to call this method.

impl<'a> TwitterStreamBuilder<'a, Handle>
[src]

Attempt to start listening on a Stream and returns a Stream object which yields JSON messages from the API.

You need to call handle method before trying to call this method.

Trait Implementations

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Formats the value using the given formatter.