pub async fn search_public_chats<C: AsRef<SearchPublicChats>>(
        &self,
        search_public_chats: C,
    ) -> RTDResult<Chats> {
        let extra = search_public_chats.as_ref().extra().ok_or(NO_EXTRA)?;
        let signal = OBSERVER.subscribe(&extra);
        self.tdlib_client
            .send(self.get_client_id()?, search_public_chats.as_ref())?;
        let received = signal.await;
        OBSERVER.unsubscribe(&extra);
        match received {
            Err(_) => Err(CLOSED_RECEIVER_ERROR),
            Ok(v) => match v {
                TdType::Chats(v) => Ok(v),
                TdType::Error(v) => Err(RTDError::TDLibError(v)),
                _ => {
                    log::error!("invalid response received: {:?}", v);
                    Err(INVALID_RESPONSE_ERROR)
                }
            },
        }
    }
// Searches public chats by looking for specified query in their username and title. Currently only private chats, supergroups and channels can be public. Returns a meaningful number of results. Returns nothing if the length of the searched username prefix is less than 5. Excludes private chats with contacts and chats from the chat list from the results
Searches public chats by looking for specified query in their username and title. Currently only private chats, supergroups and channels can be public. Returns a meaningful number of results. Returns nothing if the length of the searched username prefix is less than 5. Excludes private chats with contacts and chats from the chat list from the results
Searches public chats by looking for specified query in their username and title . Currently only private chats supergroups and channels can be public . Returns a meaningful number of results . Returns nothing if the length of the searched username prefix is less than 5 . Excludes private chats with contacts and chats from the chat list from the results
pub async fn search_public_chats<C: AsRef<SearchPublicChats>>(
        &self,
        search_public_chats: C,
    ) -> RTDResult<Chats> {
        let extra = search_public_chats.as_ref().extra().ok_or(NO_EXTRA)?;
        let signal = OBSERVER.subscribe(&extra);
        self.tdlib_client
            .send(self.get_client_id()?, search_public_chats.as_ref())?;
        let received = signal.await;
        OBSERVER.unsubscribe(&extra);
        match received {
            Err(_) => Err(CLOSED_RECEIVER_ERROR),
            Ok(v) => match v {
                TdType::Chats(v) => Ok(v),
                TdType::Error(v) => Err(RTDError::TDLibError(v)),
                _ => {
                    log::error!("invalid response received: {:?}", v);
                    Err(INVALID_RESPONSE_ERROR)
                }
            },
        }
    }
pub async fn search_public_chats < C : AsRef < SearchPublicChats > > ( & self , search_public_chats : C , ) -> RTDResult < Chats > { let extra = search_public_chats . as_ref ( ) . extra ( ) . ok_or ( NO_EXTRA ) ? ; let signal = OBSERVER . subscribe ( & extra ) ; self . tdlib_client . send ( self . get_client_id ( ) ? , search_public_chats . as_ref ( ) ) ? ; let received = signal . await ; OBSERVER . unsubscribe ( & extra ) ; match received { Err ( _ ) => Err ( CLOSED_RECEIVER_ERROR ) , Ok ( v ) => match v { TdType :: Chats ( v ) => Ok ( v ) , TdType :: Error ( v ) => Err ( RTDError :: TDLibError ( v ) ) , _ => { log :: error ! ( " " v ) ; Err ( INVALID_RESPONSE_ERROR ) } } , } }
Searches public chats by looking for specified query in their username and title.
Searches public chats by looking for specified query in their username and title .
&self
search_public_chats
C
&self
search_public_chats
C