pub async fn contact_search_by_string(
        &mut self,
        query_str: String,
        search_id_list: Option<Vec<String>>,
    ) -> Result<Vec<String>, PuppetError> {
        debug!("contact_search_by_string(query_str = {})", query_str);
        let search_by_id = self
            .contact_search(
                ContactQueryFilter {
                    alias: None,
                    alias_regex: None,
                    id: Some(query_str.clone()),
                    name: None,
                    name_regex: None,
                    weixin: None,
                },
                search_id_list.clone(),
            )
            .await;
        let search_by_alias = self
            .contact_search(
                ContactQueryFilter {
                    alias: Some(query_str.clone()),
                    alias_regex: None,
                    id: None,
                    name: None,
                    name_regex: None,
                    weixin: None,
                },
                search_id_list,
            )
            .await;
        let mut filtered_contact_id_list = vec![];
        if let Ok(contact_id_list) = search_by_id {
            for contact_id in contact_id_list {
                filtered_contact_id_list.push(contact_id);
            }
        }
        if let Ok(contact_id_list) = search_by_alias {
            for contact_id in contact_id_list {
                filtered_contact_id_list.push(contact_id);
            }
        }
        Ok(filtered_contact_id_list
            .into_iter()
            .collect::<HashSet<String>>()
            .into_iter()
            .collect::<Vec<String>>())
    }
/// Search contacts by string.
///
/// Return all contacts that has an alias or name that matches the query string.
Search contacts by string.
Return all contacts that has an alias or name that matches the query string.
Search contacts by string . Return all contacts that has an alias or name that matches the query string .
pub async fn contact_search_by_string(
        &mut self,
        query_str: String,
        search_id_list: Option<Vec<String>>,
    ) -> Result<Vec<String>, PuppetError> {
        debug!("contact_search_by_string(query_str = {})", query_str);
        let search_by_id = self
            .contact_search(
                ContactQueryFilter {
                    alias: None,
                    alias_regex: None,
                    id: Some(query_str.clone()),
                    name: None,
                    name_regex: None,
                    weixin: None,
                },
                search_id_list.clone(),
            )
            .await;
        let search_by_alias = self
            .contact_search(
                ContactQueryFilter {
                    alias: Some(query_str.clone()),
                    alias_regex: None,
                    id: None,
                    name: None,
                    name_regex: None,
                    weixin: None,
                },
                search_id_list,
            )
            .await;
        let mut filtered_contact_id_list = vec![];
        if let Ok(contact_id_list) = search_by_id {
            for contact_id in contact_id_list {
                filtered_contact_id_list.push(contact_id);
            }
        }
        if let Ok(contact_id_list) = search_by_alias {
            for contact_id in contact_id_list {
                filtered_contact_id_list.push(contact_id);
            }
        }
        Ok(filtered_contact_id_list
            .into_iter()
            .collect::<HashSet<String>>()
            .into_iter()
            .collect::<Vec<String>>())
    }
pub async fn contact_search_by_string ( & mut self , query_str : String , search_id_list : Option < Vec < String > > , ) -> Result < Vec < String > , PuppetError > { debug ! ( " " query_str ) ; let search_by_id = self . contact_search ( ContactQueryFilter { alias : None , alias_regex : None , id : Some ( query_str . clone ( ) ) , name : None , name_regex : None , weixin : None , } , search_id_list . clone ( ) , ) . await ; let search_by_alias = self . contact_search ( ContactQueryFilter { alias : Some ( query_str . clone ( ) ) , alias_regex : None , id : None , name : None , name_regex : None , weixin : None , } , search_id_list , ) . await ; let mut filtered_contact_id_list = vec ! [ ] ; if let Ok ( contact_id_list ) = search_by_id { for contact_id in contact_id_list { filtered_contact_id_list . push ( contact_id ) ; } } if let Ok ( contact_id_list ) = search_by_alias { for contact_id in contact_id_list { filtered_contact_id_list . push ( contact_id ) ; } } Ok ( filtered_contact_id_list . into_iter ( ) . collect :: < HashSet < String > > ( ) . into_iter ( ) . collect :: < Vec < String > > ( ) ) }
Search contacts by string.
Search contacts by string .
&mut self
query_str
String
search_id_list
Option<Vec<String>>
&mut self
query_str
String
search_id_list
Option<Vec<String>>