Struct contiguous_mem::ImplConcurrent
source · pub struct ImplConcurrent;Expand description
A marker struct representing the behavior specialization for thread-safe operations. This implementation ensures that the container’s operations can be used safely in asynchronous contexts, utilizing mutexes to prevent data races.
Trait Implementations§
source§impl Clone for ImplConcurrent
impl Clone for ImplConcurrent
source§fn clone(&self) -> ImplConcurrent
fn clone(&self) -> ImplConcurrent
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<T: ?Sized> ContiguousMemoryReference<T, ImplConcurrent> for SyncContiguousMemoryRef<T>
impl<T: ?Sized> ContiguousMemoryReference<T, ImplConcurrent> for SyncContiguousMemoryRef<T>
source§fn get<'a>(
&'a self
) -> Result<MemoryReadGuard<'a, T, ImplConcurrent>, LockingError>where
T: RefSizeReq,
fn get<'a>( &'a self ) -> Result<MemoryReadGuard<'a, T, ImplConcurrent>, LockingError>where T: RefSizeReq,
Returns a reference to data at its current location or returns a
LockingError::Poisoned error
if the Mutex holding the base address pointer has been poisoned.
If the data is mutably accessed, this method will block the current thread until it becomes available.
source§fn try_get<'a>(
&'a self
) -> Result<MemoryReadGuard<'a, T, ImplConcurrent>, LockingError>where
T: RefSizeReq,
fn try_get<'a>( &'a self ) -> Result<MemoryReadGuard<'a, T, ImplConcurrent>, LockingError>where T: RefSizeReq,
Returns a reference to data at its current location or returns a
LockingError::Poisoned error
if the Mutex holding the base address pointer has been poisoned.
If the data is mutably accessed, this method return a
LockingError::WouldBlock
error.
source§fn get_mut<'a>(
&'a mut self
) -> Result<MemoryWriteGuard<'a, T, ImplConcurrent>, LockingError>where
T: RefSizeReq,
fn get_mut<'a>( &'a mut self ) -> Result<MemoryWriteGuard<'a, T, ImplConcurrent>, LockingError>where T: RefSizeReq,
Returns or write guard to referenced data at its current location a
LockingError::Poisoned error if the Mutex holding the base address
pointer or the Mutex holding concurrent mutable access flag has been
poisoned.
source§fn try_get_mut<'a>(
&'a mut self
) -> Result<MemoryWriteGuard<'a, T, ImplConcurrent>, LockingError>where
T: RefSizeReq,
fn try_get_mut<'a>( &'a mut self ) -> Result<MemoryWriteGuard<'a, T, ImplConcurrent>, LockingError>where T: RefSizeReq,
Returns a write guard to referenced data at its current location or a
LockingError if that isn’t possible.
This function can return the following errors:
-
LockingError::Poisonederror if the Mutex holding the base address pointer or the Mutex holding mutable access exclusion flag has been poisoned. -
LockingError::WouldBlockerror if accessing referenced data chunk would be blocking.
§type BorrowError = LockingError
type BorrowError = LockingError
source§impl PartialEq<ImplConcurrent> for ImplConcurrent
impl PartialEq<ImplConcurrent> for ImplConcurrent
source§fn eq(&self, other: &ImplConcurrent) -> bool
fn eq(&self, other: &ImplConcurrent) -> bool
self and other values to be equal, and is used
by ==.source§impl StoreData<ImplConcurrent> for ContiguousMemoryStorage<ImplConcurrent>
impl StoreData<ImplConcurrent> for ContiguousMemoryStorage<ImplConcurrent>
source§unsafe fn store_data<T: StoreRequirements>(
&mut self,
data: *mut T,
layout: Layout
) -> Result<SyncContiguousMemoryRef<T>, LockingError>
unsafe fn store_data<T: StoreRequirements>( &mut self, data: *mut T, layout: Layout ) -> Result<SyncContiguousMemoryRef<T>, LockingError>
Returns a SyncContiguousMemoryRef pointing to the stored value, or a
LockingError::Poisoned error when the AllocationTracker
associated with the memory container is poisoned.