Skip to main content

GlobalSearchBuilder

Struct GlobalSearchBuilder 

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

Fluent builder for messages.searchGlobal (cross-chat search).

Created by Client::search_global_builder. All setters are chainable; call fetch to execute.

Implementations§

Source§

impl GlobalSearchBuilder

Source

pub fn folder_id(self, id: i32) -> Self

Restrict to a specific dialog folder.

Source

pub fn broadcasts_only(self, v: bool) -> Self

Only return results from broadcast channels.

Source

pub fn groups_only(self, v: bool) -> Self

Only return results from groups/supergroups.

Source

pub fn users_only(self, v: bool) -> Self

Only return results from private chats / bots.

Source

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

Apply a MessagesFilter (e.g. photos, video, etc.).

Source

pub fn min_date(self, ts: i32) -> Self

Only return messages on or after this Unix timestamp.

Source

pub fn max_date(self, ts: i32) -> Self

Only return messages on or before this Unix timestamp.

Source

pub fn offset_rate(self, r: i32) -> Self

Pagination: rate from the previous response’s last message.

Source

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

Pagination: start from this message ID.

Source

pub fn limit(self, n: i32) -> Self

Maximum number of messages to return (default 100).

Source

pub async fn fetch( self, client: &Client, ) -> Result<Vec<IncomingMessage>, InvocationError>

Execute the global search and return matching messages.

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, 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.