pub struct DynamicMemory<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> { /* private fields */ }Trait Implementations§
Source§impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> Abandonable for DynamicMemory<Allocator, Shm>
impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> Abandonable for DynamicMemory<Allocator, Shm>
Source§impl<Allocator: Debug + ShmAllocator, Shm: Debug + SharedMemory<Allocator>> Debug for DynamicMemory<Allocator, Shm>
impl<Allocator: Debug + ShmAllocator, Shm: Debug + SharedMemory<Allocator>> Debug for DynamicMemory<Allocator, Shm>
Source§impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> NamedConcept for DynamicMemory<Allocator, Shm>
impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> NamedConcept for DynamicMemory<Allocator, Shm>
Source§impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> NamedConceptBuilder<DynamicMemory<Allocator, Shm>> for DynamicMemoryBuilder<Allocator, Shm>
impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> NamedConceptBuilder<DynamicMemory<Allocator, Shm>> for DynamicMemoryBuilder<Allocator, Shm>
Source§fn new(name: &FileName) -> Self
fn new(name: &FileName) -> Self
Defines the name of the newly created
NamedConcept.Source§fn config(self, config: &Shm::Configuration) -> Self
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>
impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> NamedConceptBuilder<DynamicMemory<Allocator, Shm>> for DynamicViewBuilder<Allocator, Shm>
Source§fn new(name: &FileName) -> Self
fn new(name: &FileName) -> Self
Defines the name of the newly created
NamedConcept.Source§fn config(self, config: &Shm::Configuration) -> Self
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>
impl<Allocator: ShmAllocator, Shm: SharedMemory<Allocator>> NamedConceptMgmt for DynamicMemory<Allocator, Shm>
type Configuration = <Shm as NamedConceptMgmt>::Configuration
Source§unsafe fn remove_cfg(
name: &FileName,
config: &Shm::Configuration,
) -> Result<bool, NamedConceptRemoveError>
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>
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>
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>
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>
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>
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>
fn list() -> Result<Vec<FileName>, NamedConceptListError>
Returns a list of all available concepts with the default configuration.
Source§fn default_prefix() -> FileName
fn default_prefix() -> FileName
The default prefix of every zero copy connection
Source§fn default_path_hint() -> Path
fn default_path_hint() -> Path
The default path hint for every zero copy connection
Source§type ViewBuilder = DynamicViewBuilder<Allocator, Shm>
type ViewBuilder = DynamicViewBuilder<Allocator, Shm>
Type alias to the
ResizableSharedMemoryViewBuilder to open a
ResizableSharedMemoryView to an existing ResizableSharedMemory.Source§type MemoryBuilder = DynamicMemoryBuilder<Allocator, Shm>
type MemoryBuilder = DynamicMemoryBuilder<Allocator, Shm>
Type alias to the
ResizableSharedMemoryBuilder to create a new ResizableSharedMemory.Source§type View = DynamicView<Allocator, Shm>
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
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
fn number_of_active_segments(&self) -> usize
Returns the number of active
SharedMemory segments.Source§fn allocate(
&self,
layout: Layout,
) -> Result<ShmPointer, ResizableShmAllocationError>
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)
unsafe fn deallocate(&self, offset: PointerOffset, layout: Layout)
Release previously allocated memory Read more
Source§fn max_chunk_layout_hint(self, value: Layout) -> Self
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
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
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>
fn create( self, ) -> Result<DynamicMemory<Allocator, Shm>, SharedMemoryCreateError>
Creates new
SharedMemory. If it already exists the method will fail.Source§unsafe fn deallocate_bucket(&self, offset: PointerOffset)
unsafe fn deallocate_bucket(&self, offset: PointerOffset)
Release previously allocated memory Read more
Source§fn bucket_size(&self, segment_id: SegmentId) -> usize
fn bucket_size(&self, segment_id: SegmentId) -> usize
Returns the bucket size of the corresponding
PoolAllocatorSource§fn timeout(self, value: Duration) -> Self
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>
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>where
Shm: UnsafeUnpin,
<Shm as NamedConceptMgmt>::Configuration: UnsafeUnpin,
<Allocator as ShmAllocator>::Configuration: UnsafeUnpin,
impl<Allocator, Shm> UnwindSafe for DynamicMemory<Allocator, Shm>where
Shm: UnwindSafe + RefUnwindSafe,
Allocator: UnwindSafe + RefUnwindSafe,
<Shm as NamedConceptMgmt>::Configuration: UnwindSafe,
<Allocator as ShmAllocator>::Configuration: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more