pub fn new_search(
        &mut self,
        service_uuid: bredr::ServiceClassProfileIdentifier,
        attr_ids: Vec<u16>,
        proxy: bredr::SearchResultsProxy,
    ) -> impl Future<Output = ()> {
        let search_stream = proxy.take_event_stream();

        let search_handle = {
            let mut w_search_mgr = self.search_mgr.write();
            w_search_mgr.add(service_uuid, attr_ids, proxy)
        };

        let peer_id = self.id.clone();
        let uuid = service_uuid.clone();
        let search_mgr_clone = self.search_mgr.clone();
        let closed_fut = async move {
            let _ = search_stream.map(|_| ()).collect::<()>().await;
            if search_mgr_clone.write().remove(search_handle) {
                info!("Peer {} unregistering service search {:?}", peer_id, uuid);
            }
        };

        closed_fut
    }
/// Registers a new search for the provided `service_uuid`.
/// Returns a future that should be polled in order to remove the search
/// when `proxy` is closed.
Registers a new search for the provided `service_uuid`.
Returns a future that should be polled in order to remove the search
when `proxy` is closed.
Registers a new search for the provided ` service_uuid ` . Returns a future that should be polled in order to remove the search when ` proxy ` is closed .
pub fn new_search(
        &mut self,
        service_uuid: bredr::ServiceClassProfileIdentifier,
        attr_ids: Vec<u16>,
        proxy: bredr::SearchResultsProxy,
    ) -> impl Future<Output = ()> {
        let search_stream = proxy.take_event_stream();
        let search_handle = {
            let mut w_search_mgr = self.search_mgr.write();
            w_search_mgr.add(service_uuid, attr_ids, proxy)
        };
        let peer_id = self.id.clone();
        let uuid = service_uuid.clone();
        let search_mgr_clone = self.search_mgr.clone();
        let closed_fut = async move {
            let _ = search_stream.map(|_| ()).collect::<()>().await;
            if search_mgr_clone.write().remove(search_handle) {
                info!("Peer {} unregistering service search {:?}", peer_id, uuid);
            }
        };
        closed_fut
    }
pub fn new_search ( & mut self , service_uuid : bredr :: ServiceClassProfileIdentifier , attr_ids : Vec < u16 > , proxy : bredr :: SearchResultsProxy , ) -> impl Future < Output = ( ) > { let search_stream = proxy . take_event_stream ( ) ; let search_handle = { let mut w_search_mgr = self . search_mgr . write ( ) ; w_search_mgr . add ( service_uuid , attr_ids , proxy ) } ; let peer_id = self . id . clone ( ) ; let uuid = service_uuid . clone ( ) ; let search_mgr_clone = self . search_mgr . clone ( ) ; let closed_fut = async move { let _ = search_stream . map ( | _ | ( ) ) . collect :: < ( ) > ( ) . await ; if search_mgr_clone . write ( ) . remove ( search_handle ) { info ! ( " " peer_id uuid ) ; } } ; closed_fut }
Registers a new search for the provided `service_uuid`.
Registers a new search for the provided ` service_uuid ` .
&mut self
service_uuid
bredr::ServiceClassProfileIdentifier
attr_ids
Vec<u16>
proxy
bredr::SearchResultsProxy
&mut self
service_uuid
bredr::ServiceClassProfileIdentifier
attr_ids
Vec<u16>
proxy
bredr::SearchResultsProxy