fn hdl_need_read(hdl: u32) {
        let wakeup = with_handle(hdl, |obj| match obj {
            FidlHandle::LeftChannel(cs, _) => match *cs.lock() {
                ChannelState::Closed => true,
                ChannelState::Open(ref mut st, _) => {
                    if st.messages.is_empty() {
                        st.need_read = true;
                        false
                    } else {
                        true
                    }
                }
            },
            FidlHandle::RightChannel(cs, _) => match *cs.lock() {
                ChannelState::Closed => true,
                ChannelState::Open(_, ref mut st) => {
                    if st.messages.is_empty() {
                        st.need_read = true;
                        false
                    } else {
                        true
                    }
                }
            },
            FidlHandle::LeftStreamSocket(cs, _) => match *cs.lock() {
                StreamSocketState { open: false, .. } => true,
                StreamSocketState { left: ref mut st, .. } => {
                    if st.bytes.is_empty() {
                        st.need_read = true;
                        false
                    } else {
                        true
                    }
                }
            },
            FidlHandle::RightStreamSocket(cs, _) => match *cs.lock() {
                StreamSocketState { open: false, .. } => true,
                StreamSocketState { right: ref mut st, .. } => {
                    if st.bytes.is_empty() {
                        st.need_read = true;
                        false
                    } else {
                        true
                    }
                }
            },
            FidlHandle::LeftDatagramSocket(cs, _) => match *cs.lock() {
                DatagramSocketState { open: false, .. } => true,
                DatagramSocketState { left: ref mut st, .. } => {
                    if st.bytes.is_empty() {
                        st.need_read = true;
                        false
                    } else {
                        true
                    }
                }
            },
            FidlHandle::RightDatagramSocket(cs, _) => match *cs.lock() {
                DatagramSocketState { open: false, .. } => true,
                DatagramSocketState { right: ref mut st, .. } => {
                    if st.bytes.is_empty() {
                        st.need_read = true;
                        false
                    } else {
                        true
                    }
                }
            },
        });
        if wakeup {
            hdl_awaken(hdl);
        }
    }
/// Signal that a read is required
Signal that a read is required
Signal that a read is required
fn hdl_need_read(hdl: u32) {
        let wakeup = with_handle(hdl, |obj| match obj {
            FidlHandle::LeftChannel(cs, _) => match *cs.lock() {
                ChannelState::Closed => true,
                ChannelState::Open(ref mut st, _) => {
                    if st.messages.is_empty() {
                        st.need_read = true;
                        false
                    } else {
                        true
                    }
                }
            },
            FidlHandle::RightChannel(cs, _) => match *cs.lock() {
                ChannelState::Closed => true,
                ChannelState::Open(_, ref mut st) => {
                    if st.messages.is_empty() {
                        st.need_read = true;
                        false
                    } else {
                        true
                    }
                }
            },
            FidlHandle::LeftStreamSocket(cs, _) => match *cs.lock() {
                StreamSocketState { open: false, .. } => true,
                StreamSocketState { left: ref mut st, .. } => {
                    if st.bytes.is_empty() {
                        st.need_read = true;
                        false
                    } else {
                        true
                    }
                }
            },
            FidlHandle::RightStreamSocket(cs, _) => match *cs.lock() {
                StreamSocketState { open: false, .. } => true,
                StreamSocketState { right: ref mut st, .. } => {
                    if st.bytes.is_empty() {
                        st.need_read = true;
                        false
                    } else {
                        true
                    }
                }
            },
            FidlHandle::LeftDatagramSocket(cs, _) => match *cs.lock() {
                DatagramSocketState { open: false, .. } => true,
                DatagramSocketState { left: ref mut st, .. } => {
                    if st.bytes.is_empty() {
                        st.need_read = true;
                        false
                    } else {
                        true
                    }
                }
            },
            FidlHandle::RightDatagramSocket(cs, _) => match *cs.lock() {
                DatagramSocketState { open: false, .. } => true,
                DatagramSocketState { right: ref mut st, .. } => {
                    if st.bytes.is_empty() {
                        st.need_read = true;
                        false
                    } else {
                        true
                    }
                }
            },
        });
        if wakeup {
            hdl_awaken(hdl);
        }
    }
fn hdl_need_read ( hdl : u32 ) { let wakeup = with_handle ( hdl , | obj | match obj { FidlHandle :: LeftChannel ( cs , _ ) => match * cs . lock ( ) { ChannelState :: Closed => true , ChannelState :: Open ( ref mut st , _ ) => { if st . messages . is_empty ( ) { st . need_read = true ; false } else { true } } } , FidlHandle :: RightChannel ( cs , _ ) => match * cs . lock ( ) { ChannelState :: Closed => true , ChannelState :: Open ( _ , ref mut st ) => { if st . messages . is_empty ( ) { st . need_read = true ; false } else { true } } } , FidlHandle :: LeftStreamSocket ( cs , _ ) => match * cs . lock ( ) { StreamSocketState { open : false , .. } => true , StreamSocketState { left : ref mut st , .. } => { if st . bytes . is_empty ( ) { st . need_read = true ; false } else { true } } } , FidlHandle :: RightStreamSocket ( cs , _ ) => match * cs . lock ( ) { StreamSocketState { open : false , .. } => true , StreamSocketState { right : ref mut st , .. } => { if st . bytes . is_empty ( ) { st . need_read = true ; false } else { true } } } , FidlHandle :: LeftDatagramSocket ( cs , _ ) => match * cs . lock ( ) { DatagramSocketState { open : false , .. } => true , DatagramSocketState { left : ref mut st , .. } => { if st . bytes . is_empty ( ) { st . need_read = true ; false } else { true } } } , FidlHandle :: RightDatagramSocket ( cs , _ ) => match * cs . lock ( ) { DatagramSocketState { open : false , .. } => true , DatagramSocketState { right : ref mut st , .. } => { if st . bytes . is_empty ( ) { st . need_read = true ; false } else { true } } } , } ) ; if wakeup { hdl_awaken ( hdl ) ; } }
Signal that a read is required
Signal that a read is required
hdl
u32
hdl
u32