pub struct RcShMemProvider<SP>
where SP: ShMemProvider,
{ /* private fields */ }
Expand description

A Reference Counted ShMemProvider, that can use internal mutability. Useful if the ShMemProvider needs to keep local state.

Implementations§

source§

impl<SP> RcShMemProvider<ServedShMemProvider<SP>>
where SP: ShMemProvider + Debug,

source

pub fn on_restart(&mut self)

Forward to ServedShMemProvider::on_restart

Trait Implementations§

source§

impl<SP> Clone for RcShMemProvider<SP>
where SP: ShMemProvider + Clone,

source§

fn clone(&self) -> RcShMemProvider<SP>

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<SP> Debug for RcShMemProvider<SP>
where SP: ShMemProvider + Debug,

source§

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

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

impl<SP> Default for RcShMemProvider<SP>
where SP: ShMemProvider + Debug,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<SP> ShMemProvider for RcShMemProvider<SP>
where SP: ShMemProvider + Debug,

source§

fn pre_fork(&mut self) -> Result<(), Error>

This method should be called before a fork or a thread creation event, allowing the ShMemProvider to get ready for a potential reset of thread specific info, and for potential reconnects.

source§

fn post_fork(&mut self, is_child: bool) -> Result<(), Error>

After fork, make sure everything gets set up correctly internally.

§

type ShMem = RcShMem<SP>

The actual shared map handed out by this ShMemProvider.
source§

fn new() -> Result<Self, Error>

Create a new instance of the provider
source§

fn new_shmem(&mut self, map_size: usize) -> Result<Self::ShMem, Error>

Create a new shared memory mapping
source§

fn shmem_from_id_and_size( &mut self, id: ShMemId, size: usize ) -> Result<Self::ShMem, Error>

Get a mapping given its id and size
source§

fn release_shmem(&mut self, map: &mut Self::ShMem)

Release the resources associated with the given ShMem
source§

fn clone_ref(&mut self, mapping: &Self::ShMem) -> Result<Self::ShMem, Error>

Create a new sharedmap reference from an existing id and len
source§

fn new_shmem_object<T: Sized + 'static>(&mut self) -> Result<Self::ShMem, Error>

Create a new shared memory mapping to hold an object of the given type
source§

fn new_shmem_objects_array<T: Sized + 'static>( &mut self, len: usize ) -> Result<Self::ShMem, Error>

Create a new shared memory mapping to hold an array of objects of the given type
source§

fn shmem_object_from_id<T: Sized + 'static>( &mut self, id: ShMemId ) -> Result<Self::ShMem, Error>

Get a mapping given its id to hold an object of the given type
source§

fn shmem_from_description( &mut self, description: ShMemDescription ) -> Result<Self::ShMem, Error>

Get a mapping given a description
source§

fn existing_from_env(&mut self, env_name: &str) -> Result<Self::ShMem, Error>

Reads an existing map config from env vars, then maps it

Auto Trait Implementations§

§

impl<SP> !RefUnwindSafe for RcShMemProvider<SP>

§

impl<SP> !Send for RcShMemProvider<SP>

§

impl<SP> !Sync for RcShMemProvider<SP>

§

impl<SP> Unpin for RcShMemProvider<SP>

§

impl<SP> !UnwindSafe for RcShMemProvider<SP>

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.