/// View of the full buffer, shifted by an offset.
///
/// # Safety
///
/// Provides raw access to the slice. The offset has to be <= the
/// [capacity](DoubleMappedBuffer::capacity) of the buffer.
View of the full buffer, shifted by an offset.
View of the full buffer shifted by an offset .
pub unsafe fn slice_with_offset(&self, offset: usize) -> &[T] {
        let addr = self.buffer.addr() as usize;
        debug_assert_eq!(addr % mem::align_of::<T>(), 0);
        debug_assert!(offset <= self.buffer.capacity());
        slice::from_raw_parts((addr as *const T).add(offset), self.buffer.capacity())
    }
pub unsafe fn slice_with_offset ( & self , offset : usize ) -> & [ T ] { let addr = self . buffer . addr ( ) as usize ; debug_assert_eq ! ( addr mem align_of T ( ) 0 ) ; debug_assert ! ( offset self buffer capacity ( ) ) ; slice :: from_raw_parts ( ( addr as * const T ) . add ( offset ) , self . buffer . capacity ( ) ) }
View of the full buffer, shifted by an offset.
View of the full buffer shifted by an offset .
&self
offset
usize
safety
Provides raw access to the slice. The offset has to be <= the
[capacity](DoubleMappedBuffer::capacity) of the buffer.
Provides raw access to the slice . The offset has to be < = the [ capacity ] ( DoubleMappedBuffer :: capacity ) of the buffer .