Skip to main content

GlobalSearchIter

Type Alias GlobalSearchIter 

Source
pub type GlobalSearchIter = IterBuffer<SearchGlobal, Message>;
Expand description

Iterator returned by Client::search_all_messages.

Aliased Type§

pub struct GlobalSearchIter { /* private fields */ }

Implementations§

Source§

impl GlobalSearchIter

Source

pub fn offset_id(self, offset: i32) -> Self

Changes the message identifier upper bound.

Source

pub fn query(self, query: &str) -> Self

Changes the query of the search. Telegram servers perform a somewhat fuzzy search over this query (so a word in singular may also return messages with the word in plural, for example).

Source

pub fn filter(self, filter: MessagesFilter) -> Self

Changes the media filter. Only messages with this type of media will be fetched.

Source

pub async fn total(&mut self) -> Result<usize, InvocationError>

Determines how many messages there are in total.

This only performs a network call if next has not been called before.

Source

pub async fn next(&mut self) -> Result<Option<Message>, InvocationError>

Return the next Message from the internal buffer, filling the buffer previously if it’s empty.

Returns None if the limit is reached or there are no messages left.