pub fn verify_layer_support<'a, 'cs, Cs>(&'a self, layer_names: Cs) -> VdResult<bool>
            where 'cs: 'a, Cs: 'cs + Into<CharStrs<'cs>> {
        let available_layers = self.enumerate_instance_layer_properties()?;
        // Print available layers:
        for layer_props in &available_layers {
            unsafe {
                if PRINT { println!("Available layer: '{}'",
                    CStr::from_ptr(layer_props.layerName.as_ptr()).to_str().unwrap()); }
            }
        }

        // Verify that validation layer is available:
        for &layer_name in layer_names.into().as_ptr_slice() {
            let mut layer_found = false;
            for layer_props in &available_layers {
                unsafe {
                    if CStr::from_ptr(layer_name) == CStr::from_ptr(layer_props.layerName.as_ptr()) {
                        if PRINT { println!("Layer validated: '{}'",
                            CStr::from_ptr(layer_name).to_str().unwrap()); }
                        layer_found = true;
                        break;
                    }
                }
            }
            if !layer_found { return Ok(false); }
        }
        Ok(true)
    }
/// Verifies that each layer name listed is available.
Verifies that each layer name listed is available.
Verifies that each layer name listed is available .
pub fn verify_layer_support<'a, 'cs, Cs>(&'a self, layer_names: Cs) -> VdResult<bool>
            where 'cs: 'a, Cs: 'cs + Into<CharStrs<'cs>> {
        let available_layers = self.enumerate_instance_layer_properties()?;
        // Print available layers:
        for layer_props in &available_layers {
            unsafe {
                if PRINT { println!("Available layer: '{}'",
                    CStr::from_ptr(layer_props.layerName.as_ptr()).to_str().unwrap()); }
            }
        }
        // Verify that validation layer is available:
        for &layer_name in layer_names.into().as_ptr_slice() {
            let mut layer_found = false;
            for layer_props in &available_layers {
                unsafe {
                    if CStr::from_ptr(layer_name) == CStr::from_ptr(layer_props.layerName.as_ptr()) {
                        if PRINT { println!("Layer validated: '{}'",
                            CStr::from_ptr(layer_name).to_str().unwrap()); }
                        layer_found = true;
                        break;
                    }
                }
            }
            if !layer_found { return Ok(false); }
        }
        Ok(true)
    }
pub fn verify_layer_support < ' a , ' cs , Cs > ( & ' a self , layer_names : Cs ) -> VdResult < bool > where ' cs : ' a , Cs : ' cs + Into < CharStrs < ' cs > > { let available_layers = self . enumerate_instance_layer_properties ( ) ? ; // Print available layers: for layer_props in & available_layers { unsafe { if PRINT { println ! ( " " CStr from_ptr ( layer_props layerName as_ptr ( ) ) to_str ( ) unwrap ( ) ) ; } } } // Verify that validation layer is available: for & layer_name in layer_names . into ( ) . as_ptr_slice ( ) { let mut layer_found = false ; for layer_props in & available_layers { unsafe { if CStr :: from_ptr ( layer_name ) == CStr :: from_ptr ( layer_props . layerName . as_ptr ( ) ) { if PRINT { println ! ( " " CStr from_ptr ( layer_name ) to_str ( ) unwrap ( ) ) ; } layer_found = true ; break ; } } } if ! layer_found { return Ok ( false ) ; } } Ok ( true ) }
Verifies that each layer name listed is available.
Verifies that each layer name listed is available .
&'a self
layer_names
Cs
&'a self
layer_names
Cs