/// Delivers the `channel` to the client that has registered the `server_channel`.
/// Returns an error if delivery fails or if there is no such client.
Delivers the `channel` to the client that has registered the `server_channel`.
Returns an error if delivery fails or if there is no such client.
Delivers the ` channel ` to the client that has registered the ` server_channel ` . Returns an error if delivery fails or if there is no such client .
pub async fn deliver_channel(
        &self,
        peer_id: PeerId,
        server_channel: ServerChannel,
        channel: Channel,
    ) -> Result<(), Error> {
        let inner = self.inner.lock().await;
        let client = inner
            .channel_receivers
            .get(&server_channel)
            .ok_or(format_err!("ServerChannel {:?} not registered", server_channel))?;
        // Build the RFCOMM protocol descriptor and relay the channel.
        let mut protocol: Vec<bredr::ProtocolDescriptor> =
            build_rfcomm_protocol(server_channel).iter().map(Into::into).collect();
        client
            .connection_receiver
            .connected(
                &mut peer_id.into(),
                bredr::Channel::try_from(channel).unwrap(),
                &mut protocol.iter_mut(),
            )
            .map_err(|e| format_err!("{:?}", e))
    }
pub async fn deliver_channel ( & self , peer_id : PeerId , server_channel : ServerChannel , channel : Channel , ) -> Result < ( ) , Error > { let inner = self . inner . lock ( ) . await ; let client = inner . channel_receivers . get ( & server_channel ) . ok_or ( format_err ! ( " " server_channel ) ) ? ; // Build the RFCOMM protocol descriptor and relay the channel. let mut protocol : Vec < bredr :: ProtocolDescriptor > = build_rfcomm_protocol ( server_channel ) . iter ( ) . map ( Into :: into ) . collect ( ) ; client . connection_receiver . connected ( & mut peer_id . into ( ) , bredr :: Channel :: try_from ( channel ) . unwrap ( ) , & mut protocol . iter_mut ( ) , ) . map_err ( | e | format_err ! ( " " e ) ) }
Delivers the `channel` to the client that has registered the `server_channel`.
Delivers the ` channel ` to the client that has registered the ` server_channel ` .
&self
peer_id
PeerId
server_channel
ServerChannel
channel
Channel