Struct twitter_stream::TwitterStreamBuilder
[−]
[src]
pub struct TwitterStreamBuilder<'a> { /* fields omitted */ }
A builder for TwitterStream
.
Methods
impl<'a> TwitterStreamBuilder<'a>
[src]
fn custom(method: Method,
end_point: &'a str,
consumer_key: &'a str,
consumer_secret: &'a str,
token: &'a str,
token_secret: &'a str)
-> Self
end_point: &'a str,
consumer_key: &'a str,
consumer_secret: &'a str,
token: &'a str,
token_secret: &'a str)
-> Self
Constructs a builder for a stream from custom end point.
fn filter(consumer_key: &'a str,
consumer_secret: &'a str,
token: &'a str,
token_secret: &'a str)
-> Self
consumer_secret: &'a str,
token: &'a str,
token_secret: &'a str)
-> Self
Create a builder for POST statuses/filter
.
See the Twitter Developer Documentation for more information.
fn sample(consumer_key: &'a str,
consumer_secret: &'a str,
token: &'a str,
token_secret: &'a str)
-> Self
consumer_secret: &'a str,
token: &'a str,
token_secret: &'a str)
-> Self
Create a builder for GET statuses/sample
.
See the Twitter Developer Documentation for more information.
fn firehose(consumer_key: &'a str,
consumer_secret: &'a str,
token: &'a str,
token_secret: &'a str)
-> Self
consumer_secret: &'a str,
token: &'a str,
token_secret: &'a str)
-> Self
Create a builder for GET statuses/firehose
. This endpoint requires special permission to access.
See the Twitter Developer Documentation for more information.
fn user(consumer_key: &'a str,
consumer_secret: &'a str,
token: &'a str,
token_secret: &'a str)
-> Self
consumer_secret: &'a str,
token: &'a str,
token_secret: &'a str)
-> Self
Create a builder for GET user
(a.k.a. User Stream).
See the Twitter Developer Documentation for more information.
fn site(consumer_key: &'a str,
consumer_secret: &'a str,
token: &'a str,
token_secret: &'a str)
-> Self
consumer_secret: &'a str,
token: &'a str,
token_secret: &'a str)
-> Self
Create a builder for GET site
(a.k.a. Site Stream).
See the Twitter Developer Documentation for more information.
fn timeout(&mut self, timeout: Duration) -> &mut Self
Set a timeout for the stream. The default is 90 secs.
fn stall_warnings(&mut self, stall_warnings: bool) -> &mut Self
Set whether to receive messages when in danger of being disconnected.
See the Twitter Developer Documentation for more information.
fn filter_level(&mut self, filter_level: FilterLevel) -> &mut Self
Set the minimum filter_level
Tweet attribute to receive. The default is FilterLevel::None
.
See the Twitter Developer Documentation for more information.
fn replies(&mut self, replies: bool) -> &mut Self
Set whether to receive all @replies.
See the Twitter Developer Documentation for more information.
fn client<T: Into<Option<&'a Client>>>(&mut self, client: T) -> &mut Self
Set a custom hyper::client::Client
object to use when connecting to the Stream.
fn user_agent<T: Into<Option<&'a str>>>(&mut self, user_agent: T) -> &mut Self
Set a user agent string to be sent when connectiong to the Stream.
fn language<T: Into<Option<&'a str>>>(&mut self, language: T) -> &mut Self
Set a comma-separated language identifiers to only receive Tweets written in the specified languages.
See the Twitter Developer Documentation for more information.
fn follow<T: Into<Option<&'a [UserId]>>>(&mut self, follow: T) -> &mut Self
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
fn track<T: Into<Option<&'a str>>>(&mut self, track: T) -> &mut Self
A comma separated list of phrases to filter Tweets by.
See the Twitter Developer Documentation for more information.
fn locations<T: Into<Option<&'a [((f64, f64), (f64, f64))]>>>(&mut self,
locations: T)
-> &mut Self
locations: T)
-> &mut Self
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.
fn count<T: Into<Option<i32>>>(&mut self, count: T) -> &mut Self
The count
parameter. This parameter requires elevated access to use.
See the Twitter Developer Documentation for more information.
fn with<T: Into<Option<With>>>(&mut self, with: T) -> &mut Self
Set types of messages delivered to User and Site Streams clients.
impl<'a> TwitterStreamBuilder<'a>
[src]
fn listen(&self) -> Result<TwitterStream>
Attempt to start listening on the Stream API and returns a stream which yields parsed messages from the API.
fn listen_json(&self) -> Result<TwitterJsonStream>
Attempt to start listening on the Stream API and returns a stream which yields JSON messages from the API.
Trait Implementations
impl<'a> Clone for TwitterStreamBuilder<'a>
[src]
fn clone(&self) -> TwitterStreamBuilder<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more