[][src]Struct dataview::DataView

pub struct 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]

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]

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]

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]

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]

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]

Reads the largest slice from the buffer.

pub unsafe fn write_unchecked<T: Pod + ?Sized>(
    &mut self,
    offset: usize,
    value: &T
)
[src]

Writes a value to the buffer.

Trait Implementations

impl AsMut<[u8]> for DataView[src]

impl AsRef<[u8]> for DataView[src]

Auto Trait Implementations

impl Send for DataView

impl Sync for DataView

impl Unpin for DataView

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]