[][src]Struct kernel::AppSlice

pub struct AppSlice<L, T> { /* fields omitted */ }

Buffer of memory shared from an app to the kernel.

This is the type created after an app calls the allow syscall.

Implementations

impl<L, T> AppSlice<L, T>[src]

pub fn len(&self) -> usize[src]

Number of bytes in the AppSlice.

If the app died, has restarted, or its AppId identifier changed for any other reason, return an accessible length of zero, consistent with the AsRef and AsMut implementations.

pub fn ptr(&self) -> *const T[src]

Get the raw pointer to the buffer. This will be a pointer inside of the app's memory region.

pub fn iter(&self) -> Iter<T>[src]

Returns an iterator over the slice

See std::slice::iter().

Internally this uses AsRef, hence when the app dies, restarts or the AppId changes for any other reason, the iterator will be of zero length.

pub fn iter_mut(&mut self) -> IterMut<T>[src]

Returns an iterator that allows modifying each value

See std::slice::iter_mut().

Internally this uses AsMut, hence when the app dies, restarts or the AppId changes for any other reason, the iterator will be of zero length.

pub fn chunks(&self, size: usize) -> Chunks<T>[src]

Iterate over chunk_size elements at a time, starting at the beginning of the AppSlice.

See std::slice::chunks().

Internally this uses AsRef, hence when the app dies, restarts or the AppId changes for any other reason, a Chunks iterator of zero length will be returned.

pub fn chunks_mut(&mut self, size: usize) -> ChunksMut<T>[src]

Mutably iterate over chunk_size elements at a time, starting at the beginning of the AppSlice.

See std::slice::chunks_mut().

Internally this uses AsMut, hence when the app dies, restarts or the AppId changes for any other reason, a ChunksMut iterator of zero length will be returned.

Panics

Panics if chunk_size is 0.

Trait Implementations

impl<L, T> AsMut<[T]> for AppSlice<L, T>[src]

fn as_mut(&mut self) -> &mut [T][src]

Get a mutable slice reference over the userspace buffer

This first checks whether the app died, restarted, or its AppId identifier changed for any other reason. In this case, a slice of length zero is returned.

impl<L, T> AsRef<[T]> for AppSlice<L, T>[src]

fn as_ref(&self) -> &[T][src]

Get a slice reference over the userspace buffer

This first checks whether the app died, restarted, or its AppId identifier changed for any other reason. In this case, a slice of length zero is returned.

Auto Trait Implementations

impl<L, T> !Send for AppSlice<L, T>

impl<L, T> !Sync for AppSlice<L, T>

impl<L, T> Unpin for AppSlice<L, T> where
    L: Unpin

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]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.