pub fn status(&self) -> NexusStatus {
        match *self.state.lock().unwrap() {
            NexusState::Init => NexusStatus::Degraded,
            NexusState::Closed => NexusStatus::Faulted,
            NexusState::Open => {
                if self
                    .children
                    .iter()
                    // All children are online, so the Nexus is also online
                    .all(|c| c.state() == ChildState::Open)
                {
                    NexusStatus::Online
                } else if self
                    .children
                    .iter()
                    // at least one child online, so the Nexus is also online
                    .any(|c| c.state() == ChildState::Open)
                {
                    NexusStatus::Degraded
                } else {
                    // nexus has no children or at least no child is online
                    NexusStatus::Faulted
                }
            }
        }
    }
/// Status of the nexus
/// Online
/// All children must also be online
///
/// Degraded
/// At least one child must be online
///
/// Faulted
/// No child is online so the nexus is faulted
/// This may be made more configurable in the future
Status of the nexus
Online
All children must also be online

Degraded
At least one child must be online

Faulted
No child is online so the nexus is faulted
This may be made more configurable in the future
Status of the nexus Online All children must also be online Degraded At least one child must be online Faulted No child is online so the nexus is faulted This may be made more configurable in the future
pub fn status(&self) -> NexusStatus {
        match *self.state.lock().unwrap() {
            NexusState::Init => NexusStatus::Degraded,
            NexusState::Closed => NexusStatus::Faulted,
            NexusState::Open => {
                if self
                    .children
                    .iter()
                    // All children are online, so the Nexus is also online
                    .all(|c| c.state() == ChildState::Open)
                {
                    NexusStatus::Online
                } else if self
                    .children
                    .iter()
                    // at least one child online, so the Nexus is also online
                    .any(|c| c.state() == ChildState::Open)
                {
                    NexusStatus::Degraded
                } else {
                    // nexus has no children or at least no child is online
                    NexusStatus::Faulted
                }
            }
        }
    }
pub fn status ( & self ) -> NexusStatus { match * self . state . lock ( ) . unwrap ( ) { NexusState :: Init => NexusStatus :: Degraded , NexusState :: Closed => NexusStatus :: Faulted , NexusState :: Open => { if self . children . iter ( ) // All children are online, so the Nexus is also online . all ( | c | c . state ( ) == ChildState :: Open ) { NexusStatus :: Online } else if self . children . iter ( ) // at least one child online, so the Nexus is also online . any ( | c | c . state ( ) == ChildState :: Open ) { NexusStatus :: Degraded } else { // nexus has no children or at least no child is online NexusStatus :: Faulted } } } }
Status of the nexus
Online
All children must also be online
Status of the nexus Online All children must also be online
&self