pub struct AshmemShMem { /* private fields */ }
Expand description

An ashmem based impl for linux/android

Implementations§

source§

impl AshmemShMem

source

pub fn new(map_size: usize) -> Result<Self, Error>

Create a new shared memory mapping, using shmget/shmat

source

pub fn shmem_from_id_and_size( id: ShMemId, map_size: usize ) -> Result<Self, Error>

Get a crate::shmem::unix_shmem::UnixShMem of the existing ShMem mapping identified by id.

Trait Implementations§

source§

impl AsMutSlice for AshmemShMem

§

type Entry = u8

Type of the entries in this mut slice
source§

fn as_mut_slice(&mut self) -> &mut [u8]

Convert to a slice
source§

impl AsSlice for AshmemShMem

§

type Entry = u8

Type of the entries in this slice
source§

fn as_slice(&self) -> &[u8]

Convert to a slice
source§

impl Clone for AshmemShMem

source§

fn clone(&self) -> AshmemShMem

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AshmemShMem

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for AshmemShMem

Drop implementation for AshmemShMem, which cleans up the mapping.

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl ShMem for AshmemShMem

source§

fn id(&self) -> ShMemId

Get the id of this shared memory mapping
source§

fn len(&self) -> usize

Get the size of this mapping
source§

fn is_empty(&self) -> bool

Check if the mapping is empty
source§

unsafe fn as_object<T: Sized + 'static>(&self) -> &T

Convert to an owned object reference Read more
source§

unsafe fn as_object_mut<T: Sized + 'static>(&mut self) -> &mut T

Convert to an owned object mutable reference Read more
source§

unsafe fn as_objects_slice<T: Sized + 'static>(&self, len: usize) -> &[T]

Convert to a slice of type &[T] Read more
source§

unsafe fn as_objects_slice_mut<T: Sized + 'static>( &mut self, len: usize ) -> &mut [T]

Convert to a slice of type &mut [T] Read more
source§

fn description(&self) -> ShMemDescription

Get the description of the shared memory mapping
source§

fn write_to_env(&self, env_name: &str) -> Result<(), Error>

Write this map’s config to env

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Tail, T> Prepend<T> for Tail

§

type PreprendResult = Tail

The Resulting TupleList, of an Prepend::prepend() call, including the prepended entry.
source§

fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)

Prepend a value to this tuple, returning a new tuple with prepended value.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.