pub fn write(
            &self,
            bytes: &[u8],
            handles: &mut Vec<Handle>,
        ) -> Result<(), zx_status::Status> {
            let wakeup = with_handle(self.0, |obj| match obj {
                FidlHandle::LeftChannel(cs, peer) => match *cs.lock() {
                    ChannelState::Closed => Err(zx_status::Status::PEER_CLOSED),
                    ChannelState::Open(_, ref mut st) => {
                        Self::enqueue_write(st, *peer, bytes, handles)
                    }
                },
                FidlHandle::RightChannel(cs, peer) => match *cs.lock() {
                    ChannelState::Closed => Err(zx_status::Status::PEER_CLOSED),
                    ChannelState::Open(ref mut st, _) => {
                        Self::enqueue_write(st, *peer, bytes, handles)
                    }
                },
                _ => panic!("Non channel passed to Channel::write"),
            })?;
            if wakeup != INVALID_HANDLE {
                hdl_awaken(wakeup);
            }
            Ok(())
        }
/// Write a message to a channel.
Write a message to a channel.
Write a message to a channel .
pub fn write(
            &self,
            bytes: &[u8],
            handles: &mut Vec<Handle>,
        ) -> Result<(), zx_status::Status> {
            let wakeup = with_handle(self.0, |obj| match obj {
                FidlHandle::LeftChannel(cs, peer) => match *cs.lock() {
                    ChannelState::Closed => Err(zx_status::Status::PEER_CLOSED),
                    ChannelState::Open(_, ref mut st) => {
                        Self::enqueue_write(st, *peer, bytes, handles)
                    }
                },
                FidlHandle::RightChannel(cs, peer) => match *cs.lock() {
                    ChannelState::Closed => Err(zx_status::Status::PEER_CLOSED),
                    ChannelState::Open(ref mut st, _) => {
                        Self::enqueue_write(st, *peer, bytes, handles)
                    }
                },
                _ => panic!("Non channel passed to Channel::write"),
            })?;
            if wakeup != INVALID_HANDLE {
                hdl_awaken(wakeup);
            }
            Ok(())
        }
pub fn write ( & self , bytes : & [ u8 ] , handles : & mut Vec < Handle > , ) -> Result < ( ) , zx_status :: Status > { let wakeup = with_handle ( self . 0 , | obj | match obj { FidlHandle :: LeftChannel ( cs , peer ) => match * cs . lock ( ) { ChannelState :: Closed => Err ( zx_status :: Status :: PEER_CLOSED ) , ChannelState :: Open ( _ , ref mut st ) => { Self :: enqueue_write ( st , * peer , bytes , handles ) } } , FidlHandle :: RightChannel ( cs , peer ) => match * cs . lock ( ) { ChannelState :: Closed => Err ( zx_status :: Status :: PEER_CLOSED ) , ChannelState :: Open ( ref mut st , _ ) => { Self :: enqueue_write ( st , * peer , bytes , handles ) } } , _ => panic ! ( " " ) , } ) ? ; if wakeup != INVALID_HANDLE { hdl_awaken ( wakeup ) ; } Ok ( ( ) ) }
Write a message to a channel.
Write a message to a channel .
&self
bytes
&[u8]
handles
&mut Vec<Handle>
&self
bytes
&[u8]
handles
&mut Vec<Handle>