pub(super) fn send_exception(
        &self,
        exception: &Arc<Exception>,
    ) -> ZxResult<oneshot::Receiver<()>> {
        debug!(
            "Exception: {:?} ,try send to {:?}",
            exception.type_, self.type_
        );
        let mut inner = self.inner.lock();
        let (channel, rights) = match &*inner {
            ExceptionateInner::Bind { channel, rights } => (channel, *rights),
            _ => return Err(ZxError::NEXT),
        };
        let info = ExceptionInfo {
            pid: exception.thread.proc().id(),
            tid: exception.thread.id(),
            type_: exception.type_,
            padding: Default::default(),
        };
        let (object, closed) = ExceptionObject::create(exception.clone(), rights);
        let msg = MessagePacket {
            data: info.pack(),
            handles: vec![Handle::new(object, Rights::DEFAULT_EXCEPTION)],
        };
        channel.write(msg).map_err(|err| {
            if err == ZxError::PEER_CLOSED {
                *inner = ExceptionateInner::Init;
                return ZxError::NEXT;
            }
            err
        })?;
        Ok(closed)
    }
/// Send exception to the user-owned endpoint.
Send exception to the user-owned endpoint.
Send exception to the user - owned endpoint .
pub(super) fn send_exception(
        &self,
        exception: &Arc<Exception>,
    ) -> ZxResult<oneshot::Receiver<()>> {
        debug!(
            "Exception: {:?} ,try send to {:?}",
            exception.type_, self.type_
        );
        let mut inner = self.inner.lock();
        let (channel, rights) = match &*inner {
            ExceptionateInner::Bind { channel, rights } => (channel, *rights),
            _ => return Err(ZxError::NEXT),
        };
        let info = ExceptionInfo {
            pid: exception.thread.proc().id(),
            tid: exception.thread.id(),
            type_: exception.type_,
            padding: Default::default(),
        };
        let (object, closed) = ExceptionObject::create(exception.clone(), rights);
        let msg = MessagePacket {
            data: info.pack(),
            handles: vec![Handle::new(object, Rights::DEFAULT_EXCEPTION)],
        };
        channel.write(msg).map_err(|err| {
            if err == ZxError::PEER_CLOSED {
                *inner = ExceptionateInner::Init;
                return ZxError::NEXT;
            }
            err
        })?;
        Ok(closed)
    }
pub ( super ) fn send_exception ( & self , exception : & Arc < Exception > , ) -> ZxResult < oneshot :: Receiver < ( ) > > { debug ! ( " " exception type_ self type_ ) ; let mut inner = self . inner . lock ( ) ; let ( channel , rights ) = match & * inner { ExceptionateInner :: Bind { channel , rights } => ( channel , * rights ) , _ => return Err ( ZxError :: NEXT ) , } ; let info = ExceptionInfo { pid : exception . thread . proc ( ) . id ( ) , tid : exception . thread . id ( ) , type_ : exception . type_ , padding : Default :: default ( ) , } ; let ( object , closed ) = ExceptionObject :: create ( exception . clone ( ) , rights ) ; let msg = MessagePacket { data : info . pack ( ) , handles : vec ! [ Handle new ( object Rights DEFAULT_EXCEPTION ) ] , } ; channel . write ( msg ) . map_err ( | err | { if err == ZxError :: PEER_CLOSED { * inner = ExceptionateInner :: Init ; return ZxError :: NEXT ; } err } ) ? ; Ok ( closed ) }
Send exception to the user-owned endpoint.
Send exception to the user - owned endpoint .
&self
exception
&Arc<Exception>
&self
exception
&Arc<Exception>