[−][src]Struct dataview::DataView
Read and write data APIs to the underlying buffer.
Construct the data view through the Pod
trait.
Methods
impl DataView
[src]
pub fn try_copy<T: Pod>(&self, offset: usize) -> Option<T>
[src]
Copies a (potentially unaligned) value from the buffer.
pub fn try_copy_into<T: Pod + ?Sized>(
&self,
offset: usize,
dest: &mut T
) -> Option<()>
[src]
&self,
offset: usize,
dest: &mut T
) -> Option<()>
Copies a (potentially unaligned) value from the buffer into the destination.
pub fn try_read<T: Pod>(&self, offset: usize) -> Option<&T>
[src]
Reads an aligned value from the buffer.
pub fn try_read_mut<T: Pod>(&mut self, offset: usize) -> Option<&mut T>
[src]
Reads an aligned value from the buffer.
pub fn try_slice<T: Pod>(&self, offset: usize, len: usize) -> Option<&[T]>
[src]
Reads an aligned slice from the buffer.
pub fn try_slice_mut<T: Pod>(
&mut self,
offset: usize,
len: usize
) -> Option<&mut [T]>
[src]
&mut self,
offset: usize,
len: usize
) -> Option<&mut [T]>
Reads an aligned slice from the buffer.
pub fn try_slice_tail<T: Pod>(&self, offset: usize) -> Option<&[T]>
[src]
Reads the largest slice from the buffer.
pub fn try_slice_tail_mut<T: Pod>(&mut self, offset: usize) -> Option<&mut [T]>
[src]
Reads the largest slice from the buffer.
pub fn try_write<T: Pod + ?Sized>(
&mut self,
offset: usize,
value: &T
) -> Option<()>
[src]
&mut self,
offset: usize,
value: &T
) -> Option<()>
Writes a value to the buffer.
pub fn copy<T: Pod>(&self, offset: usize) -> T
[src]
Copies a (potentially unaligned) value from the buffer.
pub fn copy_into<T: Pod + ?Sized>(&self, offset: usize, dest: &mut T)
[src]
Copies a (potentially unaligned) value from the buffer into the destination.
pub fn read<T: Pod>(&self, offset: usize) -> &T
[src]
Reads an aligned value from the buffer.
pub fn read_mut<T: Pod>(&mut self, offset: usize) -> &mut T
[src]
Reads an aligned value from the buffer.
pub fn slice<T: Pod>(&self, offset: usize, len: usize) -> &[T]
[src]
Reads an aligned slice from the buffer.
pub fn slice_mut<T: Pod>(&mut self, offset: usize, len: usize) -> &mut [T]
[src]
Reads an aligned slice from the buffer.
pub fn slice_tail<T: Pod>(&self, offset: usize) -> &[T]
[src]
Reads the largest slice from the buffer.
pub fn slice_tail_mut<T: Pod>(&mut self, offset: usize) -> &mut [T]
[src]
Reads the largest slice from the buffer.
pub fn write<T: Pod + ?Sized>(&mut self, offset: usize, value: &T)
[src]
Writes a value to the buffer.
pub unsafe fn copy_unchecked<T: Pod>(&self, offset: usize) -> T
[src]
Copies a (potentially unaligned) value from the buffer.
pub unsafe fn copy_into_unchecked<T: Pod + ?Sized>(
&self,
offset: usize,
dest: &mut T
)
[src]
&self,
offset: usize,
dest: &mut T
)
Copies a (potentially unaligned) value from the buffer into the destination.
pub unsafe fn read_unchecked<T: Pod>(&self, offset: usize) -> &T
[src]
Reads an aligned value from the buffer.
pub unsafe fn read_unchecked_mut<T: Pod>(&mut self, offset: usize) -> &mut T
[src]
Reads an aligned value from the buffer.
pub unsafe fn slice_unchecked<T: Pod>(&self, offset: usize, len: usize) -> &[T]
[src]
Reads an aligned slice from the buffer.
pub unsafe fn slice_unchecked_mut<T: Pod>(
&mut self,
offset: usize,
len: usize
) -> &mut [T]
[src]
&mut self,
offset: usize,
len: usize
) -> &mut [T]
Reads an aligned slice from the buffer.
pub unsafe fn slice_tail_unchecked<T: Pod>(&self, offset: usize) -> &[T]
[src]
Reads the largest slice from the buffer.
pub unsafe fn slice_tail_unchecked_mut<T: Pod>(
&mut self,
offset: usize
) -> &mut [T]
[src]
&mut self,
offset: usize
) -> &mut [T]
Reads the largest slice from the buffer.
pub unsafe fn write_unchecked<T: Pod + ?Sized>(
&mut self,
offset: usize,
value: &T
)
[src]
&mut self,
offset: usize,
value: &T
)
Writes a value to the buffer.