pub fn to_grpc(&self) -> rpc::Nexus {
        rpc::Nexus {
            uuid: name_to_uuid(&self.name).to_string(),
            size: self.size,
            state: rpc::NexusState::from(self.status()) as i32,
            device_uri: self.get_share_uri().unwrap_or_default(),
            children: self
                .children
                .iter()
                .map(|ch| ch.to_grpc())
                .collect::<Vec<_>>(),
            rebuilds: RebuildJob::count() as u32,
        }
    }
/// Convert nexus object to grpc representation.
///
/// We cannot use From trait because it is not value to value conversion.
/// All we have is a reference to nexus.
Convert nexus object to grpc representation.
We cannot use From trait because it is not value to value conversion.
All we have is a reference to nexus.
Convert nexus object to grpc representation . We cannot use From trait because it is not value to value conversion . All we have is a reference to nexus .
pub fn to_grpc(&self) -> rpc::Nexus {
        rpc::Nexus {
            uuid: name_to_uuid(&self.name).to_string(),
            size: self.size,
            state: rpc::NexusState::from(self.status()) as i32,
            device_uri: self.get_share_uri().unwrap_or_default(),
            children: self
                .children
                .iter()
                .map(|ch| ch.to_grpc())
                .collect::<Vec<_>>(),
            rebuilds: RebuildJob::count() as u32,
        }
    }
pub fn to_grpc ( & self ) -> rpc :: Nexus { rpc :: Nexus { uuid : name_to_uuid ( & self . name ) . to_string ( ) , size : self . size , state : rpc :: NexusState :: from ( self . status ( ) ) as i32 , device_uri : self . get_share_uri ( ) . unwrap_or_default ( ) , children : self . children . iter ( ) . map ( | ch | ch . to_grpc ( ) ) . collect :: < Vec < _ > > ( ) , rebuilds : RebuildJob :: count ( ) as u32 , } }
Convert nexus object to grpc representation.
Convert nexus object to grpc representation .
&self