pub async fn pause(&self) -> Result<(), Error> {
        extern "C" fn pause_cb(
            ss: *mut spdk_nvmf_subsystem,
            arg: *mut c_void,
            status: i32,
        ) {
            let s = unsafe { Box::from_raw(arg as *mut oneshot::Sender<i32>) };

            let ss = NvmfSubsystem::from(ss);
            if status != 0 {
                error!(
                    "Failed change subsystem state {} -- to pause",
                    ss.get_nqn()
                );
            }

            s.send(status).unwrap();
        }

        let (s, r) = oneshot::channel::<i32>();

        unsafe {
            spdk_nvmf_subsystem_pause(
                self.0.as_ptr(),
                Some(pause_cb),
                cb_arg(s),
            )
        }
        .to_result(|e| Error::Subsystem {
            source: Errno::from_i32(-e),
            nqn: self.get_nqn(),
            msg: format!("subsystem_pause returned: {}", e),
        })?;

        r.await.unwrap().to_result(|e| Error::Subsystem {
            source: Errno::from_i32(e),
            nqn: self.get_nqn(),
            msg: "failed to pause the subsystem".to_string(),
        })
    }
/// transition the subsystem to paused state
/// intended to be a temporary state while changes are made
transition the subsystem to paused state
intended to be a temporary state while changes are made
transition the subsystem to paused state intended to be a temporary state while changes are made
pub async fn pause(&self) -> Result<(), Error> {
        extern "C" fn pause_cb(
            ss: *mut spdk_nvmf_subsystem,
            arg: *mut c_void,
            status: i32,
        ) {
            let s = unsafe { Box::from_raw(arg as *mut oneshot::Sender<i32>) };
            let ss = NvmfSubsystem::from(ss);
            if status != 0 {
                error!(
                    "Failed change subsystem state {} -- to pause",
                    ss.get_nqn()
                );
            }
            s.send(status).unwrap();
        }
        let (s, r) = oneshot::channel::<i32>();
        unsafe {
            spdk_nvmf_subsystem_pause(
                self.0.as_ptr(),
                Some(pause_cb),
                cb_arg(s),
            )
        }
        .to_result(|e| Error::Subsystem {
            source: Errno::from_i32(-e),
            nqn: self.get_nqn(),
            msg: format!("subsystem_pause returned: {}", e),
        })?;
        r.await.unwrap().to_result(|e| Error::Subsystem {
            source: Errno::from_i32(e),
            nqn: self.get_nqn(),
            msg: "failed to pause the subsystem".to_string(),
        })
    }
pub async fn pause ( & self ) -> Result < ( ) , Error > { extern " " fn pause_cb ( ss : * mut spdk_nvmf_subsystem , arg : * mut c_void , status : i32 , ) { let s = unsafe { Box :: from_raw ( arg as * mut oneshot :: Sender < i32 > ) } ; let ss = NvmfSubsystem :: from ( ss ) ; if status != 0 { error ! ( " " ss get_nqn ( ) ) ; } s . send ( status ) . unwrap ( ) ; } let ( s , r ) = oneshot :: channel :: < i32 > ( ) ; unsafe { spdk_nvmf_subsystem_pause ( self . 0 . as_ptr ( ) , Some ( pause_cb ) , cb_arg ( s ) , ) } . to_result ( | e | Error :: Subsystem { source : Errno :: from_i32 ( - e ) , nqn : self . get_nqn ( ) , msg : format ! ( " " e ) , } ) ? ; r . await . unwrap ( ) . to_result ( | e | Error :: Subsystem { source : Errno :: from_i32 ( e ) , nqn : self . get_nqn ( ) , msg : " " . to_string ( ) , } ) }
transition the subsystem to paused state
intended to be a temporary state while changes are made
transition the subsystem to paused state intended to be a temporary state while changes are made
&self