SearchBuilder

Struct SearchBuilder 

Source
pub struct SearchBuilder { /* private fields */ }
Expand description

Represents a tweet search query before being sent.

Implementations§

Source§

impl SearchBuilder

Source

pub fn lang<S: Into<Cow<'static, str>>>(self, lang: S) -> Self

Restrict search results to those that have been machine-parsed as the given two-letter language code.

Source

pub fn result_type(self, result_type: ResultType) -> Self

Specify the type of search results to include. The default is Recent.

Source

pub fn count(self, count: u32) -> Self

Set the number of tweets to return per-page, up to a maximum of 100. The default is 15.

Source

pub fn until(self, year: u32, month: u32, day: u32) -> Self

Returns tweets created before the given date. Keep in mind that search is limited to the last 7 days of results, so giving a date here that’s older than a week will return no results.

Source

pub fn geocode(self, latitude: f32, longitude: f32, radius: Distance) -> Self

Restricts results to users located within the given radius of the given coordinate. This is preferably populated from location-tagged tweets, but can be filled in from the user’s profile as a fallback.

Source

pub fn since_tweet(self, since_id: u64) -> Self

Restricts results to those with higher IDs than (i.e. that were posted after) the given tweet ID.

Source

pub fn max_tweet(self, max_id: u64) -> Self

Restricts results to those with IDs no higher than (i.e. were posted earlier than) the given tweet ID. Will include the given tweet in search results.

Source

pub async fn call(self, token: &Token) -> Result<Response<SearchResult>, Error>

Finalize the search terms and return the first page of responses.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more