pub fn grid_names(&self) -> Result<Vec<String>, ()> {
        let mut num_grids = std::mem::MaybeUninit::<c_int>::uninit();
        let grid_names = std::mem::MaybeUninit::<*const *const c_char>::uninit();

        match DL_OPENVDB_API.DlVDBGetGridNames(
            self.file.as_ptr(),
            num_grids.as_mut_ptr(),
            // The memory used to store the grid names is owned by 3Delight.
            grid_names.as_ptr() as *const *const _ as _,
        ) {
            true => unsafe {
                let grid_names = grid_names.assume_init();
                let result = slice::from_raw_parts(grid_names, num_grids.assume_init() as usize)
                    .iter()
                    .map(|n| CStr::from_ptr(*n).to_string_lossy().into_owned())
                    .collect();
                // Tell 3Delight to dispose the memory.
                DL_OPENVDB_API.DlVDBFreeGridNames(grid_names);
                Ok(result)
            },
            false => Err(()),
        }
    }
/// Returns the names of all the grids stored in the OpenVDB file.
Returns the names of all the grids stored in the OpenVDB file.
Returns the names of all the grids stored in the OpenVDB file .
pub fn grid_names(&self) -> Result<Vec<String>, ()> {
        let mut num_grids = std::mem::MaybeUninit::<c_int>::uninit();
        let grid_names = std::mem::MaybeUninit::<*const *const c_char>::uninit();
        match DL_OPENVDB_API.DlVDBGetGridNames(
            self.file.as_ptr(),
            num_grids.as_mut_ptr(),
            // The memory used to store the grid names is owned by 3Delight.
            grid_names.as_ptr() as *const *const _ as _,
        ) {
            true => unsafe {
                let grid_names = grid_names.assume_init();
                let result = slice::from_raw_parts(grid_names, num_grids.assume_init() as usize)
                    .iter()
                    .map(|n| CStr::from_ptr(*n).to_string_lossy().into_owned())
                    .collect();
                // Tell 3Delight to dispose the memory.
                DL_OPENVDB_API.DlVDBFreeGridNames(grid_names);
                Ok(result)
            },
            false => Err(()),
        }
    }
pub fn grid_names ( & self ) -> Result < Vec < String > , ( ) > { let mut num_grids = std :: mem :: MaybeUninit :: < c_int > :: uninit ( ) ; let grid_names = std :: mem :: MaybeUninit :: < * const * const c_char > :: uninit ( ) ; match DL_OPENVDB_API . DlVDBGetGridNames ( self . file . as_ptr ( ) , num_grids . as_mut_ptr ( ) , // The memory used to store the grid names is owned by 3Delight. grid_names . as_ptr ( ) as * const * const _ as _ , ) { true => unsafe { let grid_names = grid_names . assume_init ( ) ; let result = slice :: from_raw_parts ( grid_names , num_grids . assume_init ( ) as usize ) . iter ( ) . map ( | n | CStr :: from_ptr ( * n ) . to_string_lossy ( ) . into_owned ( ) ) . collect ( ) ; // Tell 3Delight to dispose the memory. DL_OPENVDB_API . DlVDBFreeGridNames ( grid_names ) ; Ok ( result ) } , false => Err ( ( ) ) , } }
Returns the names of all the grids stored in the OpenVDB file.
Returns the names of all the grids stored in the OpenVDB file .
&self