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: soft.rs
    path of file: ./repos/gfx/src/backend/metal/src
    
    the code of the file until where you have to start completion: use crate::{
    command::IndexBuffer, native::RasterizerState, BufferPtr, ResourceIndex, ResourcePtr,
    SamplerPtr, TexturePtr,
};

use hal;
use metal;

use std::{fmt::Debug, ops::Range};

pub type CacheResourceIndex = u32;

pub trait Resources: Debug {
    type Data: Debug;
    type BufferArray: Debug;
    type TextureArray: Debug;
    type SamplerArray: Debug;
    type DepthStencil: Debug;
    type RenderPipeline: Debug;
    type ComputePipeline: Debug;
    type Marker: Debug + AsRef<str>;
}

#[derive(Clone, Debug, Default)]
pub struct Own {
    pub buffers: Vec<Option<BufferPtr>>,
    pub buf
    
    pub fn own_compute(&mut self, com: ComputeCommand<&Ref>) -> ComputeCommand<Self> {
        use self::ComputeCommand::*;
        match com {
            BindBuffer {
                index,
                buffer,
                offset,
            } => BindBuffer {
                index,
                buffer,
                offset,
            },
            BindBuffers {
                index,
                buffers: (buffers, offsets),
            } => BindBuffers {
                index,
                buffers: {
                    let start = self.buffers.len() as CacheResourceIndex;
                    self.buffers.extend_from_slice(buffers);
                    self.buffer_offsets.extend_from_slice(offsets);
                    start..self.buffers.len() as CacheResourceIndex
                },
            },
            BindBufferData { index, words } => BindBufferData {
                index,
                words: words.to_vec(),
            },
            BindTextures { index, textures } => BindTextures {
                index,
                textures: {
                    let start = self.textures.len() as CacheResourceIndex;
                    self.textures.extend_from_slice(textures);
                    start..self.textures.len() as CacheResourceIndex
                },
            },
            BindSamplers { index, samplers } => BindSamplers {
                index,
                samplers: {
                    let start = self.samplers.len() as CacheResourceIndex;
                    self.samplers.extend_from_slice(samplers);
                    start..self.samplers.len() as CacheResourceIndex
                },
            },
            BindPipeline(pso) => BindPipeline(pso.to_owned()),
            UseResource { resource, usage } => UseResource { resource, usage },
            Dispatch { wg_size, wg_count } => Dispatch { wg_size, wg_count },
            DispatchIndirect {
                wg_size,
                buffer,
                offset,
            } => DispatchIndirect {
                wg_size,
                buffer,
                offset,
            },
        }
    }