[−][src]Struct egg_mode::stream::StreamBuilder
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.
Methods
impl StreamBuilder[src]
pub fn follow(self, to_follow: &[u64]) -> Self[src]
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);
pub fn track<I: IntoIterator<Item = S>, S: AsRef<str>>(
self,
to_track: I
) -> Self[src]
self,
to_track: I
) -> Self
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.
pub fn language<I: IntoIterator<Item = S>, S: AsRef<str>>(
self,
languages: I
) -> Self[src]
self,
languages: I
) -> Self
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.
pub fn locations(self, locations: &[BoundingBox]) -> Self[src]
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);
pub fn filter_level(self, filter_level: FilterLevel) -> StreamBuilder[src]
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.
pub fn start(self, token: &Token) -> TwitterStream[src]
Finalizes the stream parameters and returns the resulting TwitterStream.
Auto Trait Implementations
impl RefUnwindSafe for StreamBuilder
impl Send for StreamBuilder
impl Sync for StreamBuilder
impl Unpin for StreamBuilder
impl UnwindSafe for StreamBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,