Struct contiguous_mem::refs::SyncContiguousMemoryRef
source · pub struct SyncContiguousMemoryRef<T: ?Sized> { /* private fields */ }Expand description
A synchronized (thread-safe) reference to T data stored in a
ContiguousMemoryStorage structure.
Trait Implementations§
source§impl<T: ?Sized> Clone for SyncContiguousMemoryRef<T>
impl<T: ?Sized> Clone for SyncContiguousMemoryRef<T>
source§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.