pub fn resource_data(&self, resource: ResourceType) -> Result<&[u8]> {
        if !self.has_image() {
            return Err(Error::ImageNotLoaded);
        }
        let mut data_len = 0;
        unsafe {
            let data = ffi_result(ffi::vlImageGetResourceData(resource as u32, &mut data_len))?;
            Ok(slice::from_raw_parts(data.cast(), data_len as usize))
        }
    }
/// Get a reference to the given resource data.
///
/// # Errors
///
/// Returns `Err` if the resource data cannot be get or if an image is not loaded.
Get a reference to the given resource data.
Get a reference to the given resource data .
pub fn resource_data(&self, resource: ResourceType) -> Result<&[u8]> {
        if !self.has_image() {
            return Err(Error::ImageNotLoaded);
        }
        let mut data_len = 0;
        unsafe {
            let data = ffi_result(ffi::vlImageGetResourceData(resource as u32, &mut data_len))?;
            Ok(slice::from_raw_parts(data.cast(), data_len as usize))
        }
    }
pub fn resource_data ( & self , resource : ResourceType ) -> Result < & [ u8 ] > { if ! self . has_image ( ) { return Err ( Error :: ImageNotLoaded ) ; } let mut data_len = 0 ; unsafe { let data = ffi_result ( ffi :: vlImageGetResourceData ( resource as u32 , & mut data_len ) ) ? ; Ok ( slice :: from_raw_parts ( data . cast ( ) , data_len as usize ) ) } }
Get a reference to the given resource data.
Get a reference to the given resource data .
&self
resource
ResourceType
&self
resource
ResourceType
errors
Returns `Err` if the resource data cannot be get or if an image is not loaded.
Returns ` Err ` if the resource data cannot be get or if an image is not loaded .