You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: encoder.rs
    path of file: ./repos/image/src/codecs/webp
    
    the code of the file until where you have to start completion: //! Encoding of WebP images.

use std::io::Write;

use crate::{
    error::{EncodingError, UnsupportedError, UnsupportedErrorKind},
    ExtendedColorType, ImageEncoder, ImageError, ImageFormat, ImageResult,
};

/// WebP Encoder.
pub struct WebPEncoder<W> {
    inner: image_webp::WebPEncoder<W>,
}

impl<W: Write> WebPEncoder<W> {
    /// Create a new encoder that writes i
    
    fn write_webp() {
        let img = RgbaImage::from_raw(10, 6, (0..240).collect()).unwrap();

        let mut output = Vec::new();
        super::WebPEncoder::new_lossless(&mut output)
            .write_image(
                img.inner_pixels(),
                img.width(),
                img.height(),
                crate::ExtendedColorType::Rgba8,
            )
            .unwrap();

        let img2 = crate::load_from_memory_with_format(&output, crate::ImageFormat::WebP)
            .unwrap()
            .to_rgba8();

        assert_eq!(img, img2);
    }