pub fn new_connection(&self, other: PeerId, psm: Psm) -> Result<bredr::Channel, Error> {
        let reg_handle = self
            .service_mgr
            .read()
            .psm_registered(psm)
            .ok_or(format_err!("PSM {:?} not registered", psm))?;
        let proxy = self
            .services
            .get(&reg_handle)
            .and_then(|p| p.upgrade())
            .ok_or(format_err!("Connection receiver doesn't exist"))?;

        // Build the L2CAP descriptor and notify the receiver.
        let mut protocol = build_l2cap_descriptor(psm);
        let (local, remote) = Channel::create_with_max_tx(DEFAULT_TX_SDU_SIZE);
        proxy.connected(&mut other.into(), remote.try_into()?, &mut protocol.iter_mut())?;

        // Notify observer relay of the connection.
        let _ = self.observer.as_ref().map(|o| Self::relay_connected(o, other, protocol));

        local.try_into()
    }
/// Creates a new connection between this peer and the `other` peer.
///
/// `other` specifies the PeerId of the peer initiating the connection.
/// `psm` is the L2CAP PSM number of the connection.
///
/// Returns the created Channel if the provided `psm` is valid.
Creates a new connection between this peer and the `other` peer.
`other` specifies the PeerId of the peer initiating the connection.
`psm` is the L2CAP PSM number of the connection.

Returns the created Channel if the provided `psm` is valid.
Creates a new connection between this peer and the ` other ` peer . ` other ` specifies the PeerId of the peer initiating the connection . ` psm ` is the L2CAP PSM number of the connection . Returns the created Channel if the provided ` psm ` is valid .
pub fn new_connection(&self, other: PeerId, psm: Psm) -> Result<bredr::Channel, Error> {
        let reg_handle = self
            .service_mgr
            .read()
            .psm_registered(psm)
            .ok_or(format_err!("PSM {:?} not registered", psm))?;
        let proxy = self
            .services
            .get(&reg_handle)
            .and_then(|p| p.upgrade())
            .ok_or(format_err!("Connection receiver doesn't exist"))?;
        // Build the L2CAP descriptor and notify the receiver.
        let mut protocol = build_l2cap_descriptor(psm);
        let (local, remote) = Channel::create_with_max_tx(DEFAULT_TX_SDU_SIZE);
        proxy.connected(&mut other.into(), remote.try_into()?, &mut protocol.iter_mut())?;
        // Notify observer relay of the connection.
        let _ = self.observer.as_ref().map(|o| Self::relay_connected(o, other, protocol));
        local.try_into()
    }
pub fn new_connection ( & self , other : PeerId , psm : Psm ) -> Result < bredr :: Channel , Error > { let reg_handle = self . service_mgr . read ( ) . psm_registered ( psm ) . ok_or ( format_err ! ( " " psm ) ) ? ; let proxy = self . services . get ( & reg_handle ) . and_then ( | p | p . upgrade ( ) ) . ok_or ( format_err ! ( " " ) ) ? ; // Build the L2CAP descriptor and notify the receiver. let mut protocol = build_l2cap_descriptor ( psm ) ; let ( local , remote ) = Channel :: create_with_max_tx ( DEFAULT_TX_SDU_SIZE ) ; proxy . connected ( & mut other . into ( ) , remote . try_into ( ) ? , & mut protocol . iter_mut ( ) ) ? ; // Notify observer relay of the connection. let _ = self . observer . as_ref ( ) . map ( | o | Self :: relay_connected ( o , other , protocol ) ) ; local . try_into ( ) }
Creates a new connection between this peer and the `other` peer.
Creates a new connection between this peer and the ` other ` peer .
&self
other
PeerId
psm
Psm
&self
other
PeerId
psm
Psm