fn acquire_mapping_reader<'a, T>(&self, memory: &'a B::Memory, range: Range<u64>)
        -> Result<mapping::Reader<'a, B, T>, mapping::Error>
    where
        T: Copy,
    {
        let len = range.end - range.start;
        let count = len as usize / mem::size_of::<T>();
        self.map_memory(memory, range.clone())
            .map(|ptr| unsafe {
                let start_ptr = ptr as *const _;
                self.invalidate_mapped_memory_ranges(Some((memory, range.clone())));

                mapping::Reader {
                    slice: slice::from_raw_parts(start_ptr, count),
                    memory,
                    released: false,
                }
            })
    }
/// Acquire a mapping Reader.
///
/// The accessible slice will correspond to the specified range (in bytes).
Acquire a mapping Reader.
The accessible slice will correspond to the specified range (in bytes).
Acquire a mapping Reader . The accessible slice will correspond to the specified range ( in bytes ) .
fn acquire_mapping_reader<'a, T>(&self, memory: &'a B::Memory, range: Range<u64>)
        -> Result<mapping::Reader<'a, B, T>, mapping::Error>
    where
        T: Copy,
    {
        let len = range.end - range.start;
        let count = len as usize / mem::size_of::<T>();
        self.map_memory(memory, range.clone())
            .map(|ptr| unsafe {
                let start_ptr = ptr as *const _;
                self.invalidate_mapped_memory_ranges(Some((memory, range.clone())));
                mapping::Reader {
                    slice: slice::from_raw_parts(start_ptr, count),
                    memory,
                    released: false,
                }
            })
    }
fn acquire_mapping_reader < ' a , T > ( & self , memory : & ' a B :: Memory , range : Range < u64 > ) -> Result < mapping :: Reader < ' a , B , T > , mapping :: Error > where T : Copy , { let len = range . end - range . start ; let count = len as usize / mem :: size_of :: < T > ( ) ; self . map_memory ( memory , range . clone ( ) ) . map ( | ptr | unsafe { let start_ptr = ptr as * const _ ; self . invalidate_mapped_memory_ranges ( Some ( ( memory , range . clone ( ) ) ) ) ; mapping :: Reader { slice : slice :: from_raw_parts ( start_ptr , count ) , memory , released : false , } } ) }
Acquire a mapping Reader.
Acquire a mapping Reader .
&self
memory
&'a B::Memory
range
Range<u64>