[−][src]Struct twitter_stream::builder::Builder
A builder for TwitterStream.
See the builder module documentation for details.
Implementations
impl<'a, C, A> Builder<'a, Token<C, A>> where
C: Borrow<str>,
A: Borrow<str>, [src]
C: Borrow<str>,
A: Borrow<str>,
pub fn new(token: Token<C, A>) -> Self[src]
Creates a builder.
pub fn listen(&self) -> FutureTwitterStream[src]
hyper only.Start listening on the Streaming API endpoint, returning a Future which resolves
to a Stream yielding JSON messages from the API.
Panics
This will panic if the underlying HTTPS connector failed to initialize.
pub fn listen_with_client<S, B>(
&self,
client: S
) -> FutureTwitterStream<S::Future>ⓘNotable traits for FutureTwitterStream<F>
impl<F, B, E> Future for FutureTwitterStream<F> where
F: Future<Output = Result<Response<B>, E>>,
B: Body, type Output = Result<TwitterStream<B>, Error<E>>; where
S: HttpService<B>,
B: From<Vec<u8>>, [src]
&self,
client: S
) -> FutureTwitterStream<S::Future>ⓘ
Notable traits for FutureTwitterStream<F>
impl<F, B, E> Future for FutureTwitterStream<F> where
F: Future<Output = Result<Response<B>, E>>,
B: Body, type Output = Result<TwitterStream<B>, Error<E>>;S: HttpService<B>,
B: From<Vec<u8>>,
Same as listen except that it uses client to make HTTP request
to the endpoint.
client must be able to handle the https scheme.
Panics
This will call <S as Service>::call without checking for <S as Service>::poll_ready
and may cause a panic if client is not ready to send an HTTP request yet.
Example
use tower::ServiceExt; client.ready_and().await; // Ensure that the client is ready to send a request. let stream = twitter_stream::Builder::new(token) .listen_with_client(&mut client) .await .unwrap();
impl<'a, C, A> Builder<'a, Token<C, A>>[src]
pub fn endpoint(
&mut self,
endpoint: impl Into<Option<(RequestMethod, Uri)>>
) -> &mut Self[src]
&mut self,
endpoint: impl Into<Option<(RequestMethod, Uri)>>
) -> &mut Self
Set the API endpoint URI to be connected.
This overrides the default behavior of automatically determining the endpoint to use.
pub fn token(&mut self, token: Token<C, A>) -> &mut Self[src]
Reset the token to be used to log into Twitter.
pub fn stall_warnings(&mut self, stall_warnings: bool) -> &mut Self[src]
Set whether to receive messages when in danger of being disconnected.
See the Twitter Developer Documentation for more information.
pub fn filter_level(
&mut self,
filter_level: impl Into<Option<FilterLevel>>
) -> &mut Self[src]
&mut self,
filter_level: impl Into<Option<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.
pub fn language(&mut self, language: impl Into<Cow<'a, str>>) -> &mut Self[src]
Set a comma-separated language identifiers to receive Tweets written in the specified languages only.
Setting an empty string will unset this parameter.
See the Twitter Developer Documentation for more information.
pub fn follow(&mut self, follow: impl Into<Cow<'a, [u64]>>) -> &mut Self[src]
Set a list of user IDs to receive Tweets from the specified users.
Setting an empty slice will unset this parameter.
See the Twitter Developer Documentation for more information.
pub fn track(&mut self, track: impl Into<Cow<'a, str>>) -> &mut Self[src]
A comma separated list of phrases to filter Tweets by.
Setting an empty string will unset this parameter.
See the Twitter Developer Documentation for more information.
pub fn locations(
&mut self,
locations: impl Into<Cow<'a, [BoundingBox]>>
) -> &mut Self[src]
&mut self,
locations: impl Into<Cow<'a, [BoundingBox]>>
) -> &mut Self
Set a list of bounding boxes to filter Tweets by.
Setting an empty slice will unset this parameter.
See BoundingBox and
the Twitter Developer Documentation for more information.
pub fn count(&mut self, count: impl Into<Option<i32>>) -> &mut Self[src]
The count parameter.
This parameter requires elevated access to use.
See the Twitter Developer Documentation for more information.
Trait Implementations
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Builder<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Send for Builder<'a, T> where
T: Send,
T: Send,
impl<'a, T> Sync for Builder<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for Builder<'a, T> where
T: Unpin,
T: Unpin,
impl<'a, T> UnwindSafe for Builder<'a, T> where
T: UnwindSafe,
T: UnwindSafe,
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> Instrument for T[src]
fn instrument(self, span: Span) -> Instrumented<Self>[src]
fn in_current_span(self) -> Instrumented<Self>[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> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
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>,