/// close the nexus and any children that are open
close the nexus and any children that are open
close the nexus and any children that are open
pub(crate) fn destruct(&mut self) -> NexusState {
        // a closed operation might already be in progress calling unregister
        // will trip an assertion within the external libraries
        if self.state == NexusState::Closed {
            trace!("{}: already closed", self.name);
            return self.state;
        }
        trace!("{}: closing, from state: {:?} ", self.name, self.state);
        self.children
            .iter_mut()
            .map(|c| {
                if c.state == ChildState::Open {
                    c.close();
                }
            })
            .for_each(drop);
        unsafe {
            spdk_io_device_unregister(self.as_ptr(), None);
        }
        trace!("{}: closed", self.name);
        self.set_state(NexusState::Closed)
    }
pub ( crate ) fn destruct ( & mut self ) -> NexusState { // a closed operation might already be in progress calling unregister // will trip an assertion within the external libraries if self . state == NexusState :: Closed { trace ! ( " " self name ) ; return self . state ; } trace ! ( " " self name self state ) ; self . children . iter_mut ( ) . map ( | c | { if c . state == ChildState :: Open { c . close ( ) ; } } ) . for_each ( drop ) ; unsafe { spdk_io_device_unregister ( self . as_ptr ( ) , None ) ; } trace ! ( " " self name ) ; self . set_state ( NexusState :: Closed ) }
close the nexus and any children that are open
close the nexus and any children that are open
&mut self