pub fn save(&self, buffer: &mut [u8]) -> Result<usize> {
        let len = buffer.len().try_into().map_err(|_| Error::LengthOverflow)?;
        let mut written = 0;
        unsafe {
            ffi_try!(ffi::vlImageSaveLump(
                buffer.as_mut_ptr().cast(),
                len,
                &mut written
            ));
        }
        Ok(written as usize)
    }
/// Save the image into `buffer`. Returns bytes written.
///
/// # Errors
///
/// Returns `Err` if the image saving fails
/// or if the buffer is too large for the length fit into `u32`.
Save the image into `buffer`. Returns bytes written.
Save the image into ` buffer ` . Returns bytes written .
pub fn save(&self, buffer: &mut [u8]) -> Result<usize> {
        let len = buffer.len().try_into().map_err(|_| Error::LengthOverflow)?;
        let mut written = 0;
        unsafe {
            ffi_try!(ffi::vlImageSaveLump(
                buffer.as_mut_ptr().cast(),
                len,
                &mut written
            ));
        }
        Ok(written as usize)
    }
pub fn save ( & self , buffer : & mut [ u8 ] ) -> Result < usize > { let len = buffer . len ( ) . try_into ( ) . map_err ( | _ | Error :: LengthOverflow ) ? ; let mut written = 0 ; unsafe { ffi_try ! ( ffi vlImageSaveLump ( buffer as_mut_ptr ( ) cast ( ) len mut written ) ) ; } Ok ( written as usize ) }
Save the image into `buffer`.
Save the image into ` buffer ` .
&self
buffer
&mut [u8]
&self
buffer
&mut [u8]
errors
Returns `Err` if the image saving fails
or if the buffer is too large for the length fit into `u32`.
Returns ` Err ` if the image saving fails or if the buffer is too large for the length fit into ` u32 ` .