Skip to main content

DynamicMemory

Struct DynamicMemory 

Source
pub struct DynamicMemory<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> { /* private fields */ }

Trait Implementations§

Source§

impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> Abandonable for DynamicMemory<Allocator, Shm>

Source§

unsafe fn abandon_in_place(this: NonNull<Self>)

Abandon a resource in place. Shall be used when a struct of multiple resources shall be abandoned and the resources cannot be moved out of the struct. Read more
Source§

fn abandon(self)

Source§

impl<Allocator: Debug + ShmAllocator, Shm: Debug + SharedMemory<Allocator>> Debug for DynamicMemory<Allocator, Shm>

Source§

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

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

impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> NamedConcept for DynamicMemory<Allocator, Shm>

Source§

fn name(&self) -> &FileName

Returns the name of the concept
Source§

impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> NamedConceptBuilder<DynamicMemory<Allocator, Shm>> for DynamicMemoryBuilder<Allocator, Shm>
where Shm::Builder: Debug,

Source§

fn new(name: &FileName) -> Self

Defines the name of the newly created NamedConcept.
Source§

fn config(self, config: &Shm::Configuration) -> Self

Sets the custom configuration of the concept.
Source§

impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> NamedConceptBuilder<DynamicMemory<Allocator, Shm>> for DynamicViewBuilder<Allocator, Shm>
where Shm::Builder: Debug,

Source§

fn new(name: &FileName) -> Self

Defines the name of the newly created NamedConcept.
Source§

fn config(self, config: &Shm::Configuration) -> Self

Sets the custom configuration of the concept.
Source§

impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> NamedConceptMgmt for DynamicMemory<Allocator, Shm>
where Shm::Builder: Debug,

Source§

type Configuration = <Shm as NamedConceptMgmt>::Configuration

Source§

unsafe fn remove_cfg( name: &FileName, config: &Shm::Configuration, ) -> Result<bool, NamedConceptRemoveError>

Removes an existing concept under a custom configuration. Returns true if the concepts existed and was removed, if the concept did not exist it returns false. Read more
Source§

fn does_exist_cfg( name: &FileName, config: &Shm::Configuration, ) -> Result<bool, NamedConceptDoesExistError>

Returns true if a concept with that name exists under a custom configuration, otherwise false
Source§

fn list_cfg( config: &Shm::Configuration, ) -> Result<Vec<FileName>, NamedConceptListError>

Returns a list of all available concepts with a custom configuration.
Source§

fn remove_path_hint(value: &Path) -> Result<(), NamedConceptPathHintRemoveError>

Removes the path hint directory. Will be realized only when the concept actually uses the path hint.
Source§

unsafe fn remove(name: &FileName) -> Result<bool, NamedConceptRemoveError>

Removes an existing concept. Returns true if the concepts existed and was removed, if the concept did not exist it returns false. Read more
Source§

fn does_exist(name: &FileName) -> Result<bool, NamedConceptDoesExistError>

Returns true if a concept with that name exists, otherwise false
Source§

fn list() -> Result<Vec<FileName>, NamedConceptListError>

Returns a list of all available concepts with the default configuration.
Source§

fn default_prefix() -> FileName

The default prefix of every zero copy connection
Source§

fn default_path_hint() -> Path

The default path hint for every zero copy connection
Source§

impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> ResizableSharedMemory<Allocator, Shm> for DynamicMemory<Allocator, Shm>
where Shm::Builder: Debug,

Source§

type ViewBuilder = DynamicViewBuilder<Allocator, Shm>

Source§

type MemoryBuilder = DynamicMemoryBuilder<Allocator, Shm>

Type alias to the ResizableSharedMemoryBuilder to create a new ResizableSharedMemory.
Source§

type View = DynamicView<Allocator, Shm>

Type alias to the ResizableSharedMemoryView to open an existing ResizableSharedMemory as read-only.
Source§

fn max_number_of_reallocations() -> usize

Returns how many reallocations the ResizableSharedMemory supports. If the number is exceeded any call to ResizableSharedMemory::allocate() that requires a resize of the underlying SharedMemory segments will fail.
Source§

fn number_of_active_segments(&self) -> usize

Returns the number of active SharedMemory segments.
Source§

fn allocate( &self, layout: Layout, ) -> Result<ShmPointer, ResizableShmAllocationError>

Allocates a new piece of SharedMemory if the provided Layout exceeds the current supported Layout, the memory would be out-of-memory or the number of chunks exceeds the current supported amount of chunks, a new SharedMemory segment will be created. If this fails an SharedMemoryCreateError will be returned.
Source§

unsafe fn deallocate(&self, offset: PointerOffset, layout: Layout)

Release previously allocated memory Read more
Source§

impl<Allocator, Shm: SharedMemory<Allocator>> ResizableSharedMemoryBuilder<Allocator, Shm, DynamicMemory<Allocator, Shm>> for DynamicMemoryBuilder<Allocator, Shm>
where Allocator: Debug + ShmAllocator, Shm::Builder: Debug,

Source§

fn max_chunk_layout_hint(self, value: Layout) -> Self

Provides an initial hint to the underlying ShmAllocator on how large the largest chunk will be. If the chunk exceeds the hinted Layout a new SharedMemory segment is acquired to satisfy the memory needs.
Source§

fn max_number_of_chunks_hint(self, value: usize) -> Self

Provides an initial hint to the underlying ShmAllocator on how many chunks at most will be used in parallel. If the number of chunk exceeds the hint a new SharedMemory segment is acquired to satisfy the memory needs.
Source§

fn allocation_strategy(self, value: AllocationStrategy) -> Self

Defines the AllocationStrategy that is pursued when a new SharedMemory segment is acquired.
Source§

fn create( self, ) -> Result<DynamicMemory<Allocator, Shm>, SharedMemoryCreateError>

Creates new SharedMemory. If it already exists the method will fail.
Source§

impl<Shm: SharedMemoryForPoolAllocator> ResizableSharedMemoryForPoolAllocator<Shm> for DynamicMemory<PoolAllocator, Shm>
where Shm::Builder: Debug,

Source§

unsafe fn deallocate_bucket(&self, offset: PointerOffset)

Release previously allocated memory Read more
Source§

fn bucket_size(&self, segment_id: SegmentId) -> usize

Returns the bucket size of the corresponding PoolAllocator
Source§

impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> ResizableSharedMemoryViewBuilder<Allocator, Shm, DynamicMemory<Allocator, Shm>, DynamicView<Allocator, Shm>> for DynamicViewBuilder<Allocator, Shm>
where Shm::Builder: Debug,

Source§

fn timeout(self, value: Duration) -> Self

The timeout defines how long the SharedMemoryBuilder should wait for SharedMemoryBuilder::create() to finialize the initialization. This is required when the SharedMemory is created and initialized concurrently from another process. By default it is set to Duration::ZERO for no timeout.
Source§

fn open( self, access_mode: AccessMode, ) -> Result<DynamicView<Allocator, Shm>, SharedMemoryOpenError>

Opens already existing SharedMemory. If it does not exist or the initialization is not yet finished the method will fail.

Auto Trait Implementations§

§

impl<Allocator, Shm> !Freeze for DynamicMemory<Allocator, Shm>

§

impl<Allocator, Shm> !RefUnwindSafe for DynamicMemory<Allocator, Shm>

§

impl<Allocator, Shm> Send for DynamicMemory<Allocator, Shm>

§

impl<Allocator, Shm> !Sync for DynamicMemory<Allocator, Shm>

§

impl<Allocator, Shm> Unpin for DynamicMemory<Allocator, Shm>
where Shm: Unpin, Allocator: Unpin, <Shm as NamedConceptMgmt>::Configuration: Unpin, <Allocator as ShmAllocator>::Configuration: Unpin,

§

impl<Allocator, Shm> UnsafeUnpin for DynamicMemory<Allocator, Shm>

§

impl<Allocator, Shm> UnwindSafe for DynamicMemory<Allocator, Shm>

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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.