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: backend.rs
    path of file: ./repos/luminance-rs/luminance/src
    
    the code of the file until where you have to start completion: use crate::{
  dim::Dimensionable,
  framebuffer::{Back, Framebuffer},
  pipeline::{PipelineState, WithFramebuffer, WithProgram, WithRenderState},
  pixel::{Pixel, PixelFormat, PixelType},
  primitive::Primitive,
  render_slots::{DepthChannel, DepthRenderSlot, RenderChannel, RenderSlots},
  render_state::RenderState,
  shader::{
    InUseUniBuffer, MemoryLayout, Program, Uni, UniBuffer, UniBufferRef, Uniform, Uniforms,
  },
  texture::{InUseTexture, Mipmaps, Texture, TextureSampling},
  vertex::Vertex,
  vertex_entity::{VertexEntity, VertexEntityBuilder, VertexEntityView},
  vertex_storage::{AsVertexStorage, VertexStorageFamily},
};
use std::{collections::HashMap, error::Error as ErrorTrait, fmt};

/// Cached value.
///
/// A cached value is used to prevent issuing costy GPU commands if we know the target value is
/// already set to what the command tries to set. For instance, if you ask to use a texture ID
/// `34` once, that value will be set on the GPU and cached on our side. Later, if no other texture
/// setting has occurred, if you ask to use the texture ID `34` again, because the value is cached,
/// we know the GPU is already using it, so we don’t have to perform anything GPU-wise.
///
/// This optimization has limits and sometimes, because of side-effects, it is not possible to cache
/// something correctly.
#[derive(Debug)]
pub struct Cached<T>(Option<T>);

impl<T> Cached<T>
where
  T: PartialEq,
{
  /// Start with n
    
  fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
    match self {
      TextureError::NoData { handle } => {
        write!(f, "texture {} has no data associated with", handle)
      }

      TextureError::NotEnoughTextureUnits { max } => {
        write!(f, "not enough texture units (max = {})", max)
      }

      TextureError::TextureStorageCreationFailed { cause } => {
        write!(
          f,
          "texture storage creation failed; cause: {}",
          cause
            .as_ref()
            .map(|cause| cause.to_string())
            .unwrap_or("unknown cause".to_string())
        )
      }

      TextureError::NotEnoughPixels {
        expected_bytes,
        provided_bytes,
        cause,
      } => write!(
        f,
        "not enough texels provided: expected {} bytes, provided {} bytes; cause: {}",
        expected_bytes,
        provided_bytes,
        cause
          .as_ref()
          .map(|cause| cause.to_string())
          .unwrap_or_else(|| "unknown".to_owned())
      ),

      TextureError::UnsupportedPixelFormat(fmt) => {
        write!(f, "unsupported pixel format: {:?}", fmt)
      }

      TextureError::CannotRetrieveTexels { cause } => {
        write!(
          f,
          "cannot retrieve texture’s texels; cause: {}",
          cause
            .as_ref()
            .map(|cause| cause.to_string())
            .unwrap_or_else(|| "unknown".to_owned())
        )
      }

      TextureError::CannotUploadTexels { cause } => {
        write!(
          f,
          "cannot upload texels to texture; cause: {}",
          cause
            .as_ref()
            .map(|cause| cause.to_string())
            .unwrap_or_else(|| "unknown".to_owned())
        )
      }
    }
  }