pub async fn create_metadata(
        &mut self,
    ) -> Result<NexusMetaData, MetaDataError> {
        let (bdev, _hndl) = self.get_dev().context(NexusChildError {})?;

        if let Some(partition) = self
            .probe_label()
            .await
            .context(ProbeLabelError {})?
            .partitions
            .get(0)
        {
            if partition.ent_type
                == GptGuid::from_str(Nexus::METADATA_PARTITION_TYPE_ID).unwrap()
                && partition.ent_name.name == "MayaMeta"
            {
                let mut metadata = NexusMetaData {
                    header: MetaDataHeader::new(bdev.block_len(), &partition),
                    index: Vec::new(),
                };
                self.sync_metadata(&mut metadata).await?;
                return Ok(metadata);
            }
        }

        Err(MetaDataError::MissingPartition {})
    }
/// Create a new header + index on "MetaData" partition.
Create a new header + index on "MetaData" partition.
Create a new header + index on " MetaData " partition .
pub async fn create_metadata(
        &mut self,
    ) -> Result<NexusMetaData, MetaDataError> {
        let (bdev, _hndl) = self.get_dev().context(NexusChildError {})?;
        if let Some(partition) = self
            .probe_label()
            .await
            .context(ProbeLabelError {})?
            .partitions
            .get(0)
        {
            if partition.ent_type
                == GptGuid::from_str(Nexus::METADATA_PARTITION_TYPE_ID).unwrap()
                && partition.ent_name.name == "MayaMeta"
            {
                let mut metadata = NexusMetaData {
                    header: MetaDataHeader::new(bdev.block_len(), &partition),
                    index: Vec::new(),
                };
                self.sync_metadata(&mut metadata).await?;
                return Ok(metadata);
            }
        }
        Err(MetaDataError::MissingPartition {})
    }
pub async fn create_metadata ( & mut self , ) -> Result < NexusMetaData , MetaDataError > { let ( bdev , _hndl ) = self . get_dev ( ) . context ( NexusChildError { } ) ? ; if let Some ( partition ) = self . probe_label ( ) . await . context ( ProbeLabelError { } ) ? . partitions . get ( 0 ) { if partition . ent_type == GptGuid :: from_str ( Nexus :: METADATA_PARTITION_TYPE_ID ) . unwrap ( ) && partition . ent_name . name == " " { let mut metadata = NexusMetaData { header : MetaDataHeader :: new ( bdev . block_len ( ) , & partition ) , index : Vec :: new ( ) , } ; self . sync_metadata ( & mut metadata ) . await ? ; return Ok ( metadata ) ; } } Err ( MetaDataError :: MissingPartition { } ) }
Create a new header + index on "MetaData" partition.
Create a new header + index on " MetaData " partition .
&mut self