pub fn create() -> Result<(Channel, Channel), zx_status::Status> {
            let cs = Arc::new(Mutex::new(ChannelState::Open(
                HalfChannelState::new(),
                HalfChannelState::new(),
            )));
            let mut h = HANDLES.lock();
            let left = h.insert(FidlHandle::LeftChannel(cs.clone(), INVALID_HANDLE)) as u32;
            let right = h.insert(FidlHandle::RightChannel(cs, left)) as u32;
            if let FidlHandle::LeftChannel(_, peer) = &mut h[left as usize] {
                *peer = right;
            } else {
                unreachable!();
            }
            Ok((Channel(left), Channel(right)))
        }
/// Create a channel, resulting in a pair of `Channel` objects representing both
/// sides of the channel. Messages written into one maybe read from the opposite.
Create a channel, resulting in a pair of `Channel` objects representing both
sides of the channel. Messages written into one maybe read from the opposite.
Create a channel resulting in a pair of ` Channel ` objects representing both sides of the channel . Messages written into one maybe read from the opposite .
pub fn create() -> Result<(Channel, Channel), zx_status::Status> {
            let cs = Arc::new(Mutex::new(ChannelState::Open(
                HalfChannelState::new(),
                HalfChannelState::new(),
            )));
            let mut h = HANDLES.lock();
            let left = h.insert(FidlHandle::LeftChannel(cs.clone(), INVALID_HANDLE)) as u32;
            let right = h.insert(FidlHandle::RightChannel(cs, left)) as u32;
            if let FidlHandle::LeftChannel(_, peer) = &mut h[left as usize] {
                *peer = right;
            } else {
                unreachable!();
            }
            Ok((Channel(left), Channel(right)))
        }
pub fn create ( ) -> Result < ( Channel , Channel ) , zx_status :: Status > { let cs = Arc :: new ( Mutex :: new ( ChannelState :: Open ( HalfChannelState :: new ( ) , HalfChannelState :: new ( ) , ) ) ) ; let mut h = HANDLES . lock ( ) ; let left = h . insert ( FidlHandle :: LeftChannel ( cs . clone ( ) , INVALID_HANDLE ) ) as u32 ; let right = h . insert ( FidlHandle :: RightChannel ( cs , left ) ) as u32 ; if let FidlHandle :: LeftChannel ( _ , peer ) = & mut h [ left as usize ] { * peer = right ; } else { unreachable ! ( ) ; } Ok ( ( Channel ( left ) , Channel ( right ) ) ) }
Create a channel, resulting in a pair of `Channel` objects representing both
sides of the channel.
Create a channel resulting in a pair of ` Channel ` objects representing both sides of the channel .