Struct contiguous_mem::refs::ContiguousMemoryRef
source · pub struct ContiguousMemoryRef<T: ?Sized> { /* private fields */ }Expand description
A thread-unsafe reference to T data stored in
ContiguousMemoryStorage structure.
Trait Implementations§
source§impl<T: ?Sized> Clone for ContiguousMemoryRef<T>
impl<T: ?Sized> Clone for ContiguousMemoryRef<T>
source§impl<T: ?Sized> ContiguousMemoryReference<T, ImplDefault> for ContiguousMemoryRef<T>
impl<T: ?Sized> ContiguousMemoryReference<T, ImplDefault> for ContiguousMemoryRef<T>
source§fn try_get_mut<'a>(
&'a mut self
) -> Result<MemoryWriteGuard<'a, T, ImplDefault>, RegionBorrowed>where
T: RefSizeReq,
fn try_get_mut<'a>( &'a mut self ) -> Result<MemoryWriteGuard<'a, T, ImplDefault>, RegionBorrowed>where T: RefSizeReq,
This implementation returns a RegionBorrowed error if the
represented memory region is already borrowed.
§type BorrowError = RegionBorrowed
type BorrowError = RegionBorrowed
Error type returned when the data represented by the reference can’t be
safely accessed/borrowed.
source§fn range(&self) -> ByteRange
fn range(&self) -> ByteRange
Returns a byte range within container memory this reference points to.
source§fn get<'a>(&'a self) -> MemoryReadGuard<'a, T, ImplDefault>where
T: RefSizeReq,
fn get<'a>(&'a self) -> MemoryReadGuard<'a, T, ImplDefault>where T: RefSizeReq,
Returns a reference to data at its current location and panics if the
reference has been mutably borrowed or blocks the thread for the
concurrent implementation.
source§fn try_get<'a>(
&'a self
) -> Result<MemoryReadGuard<'a, T, ImplDefault>, RegionBorrowed>where
T: RefSizeReq,
fn try_get<'a>( &'a self ) -> Result<MemoryReadGuard<'a, T, ImplDefault>, RegionBorrowed>where T: RefSizeReq,
Returns a reference to data at its current location and returns the
appropriate error if that’s not possible.
source§fn get_mut<'a>(&'a mut self) -> MemoryWriteGuard<'a, T, ImplDefault>where
T: RefSizeReq,
fn get_mut<'a>(&'a mut self) -> MemoryWriteGuard<'a, T, ImplDefault>where T: RefSizeReq,
Returns a mutable reference to data at its current location and panics
if the reference has been mutably borrowed or blocks the thread for
concurrent implementation.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for ContiguousMemoryRef<T>
impl<T> !Send for ContiguousMemoryRef<T>
impl<T> !Sync for ContiguousMemoryRef<T>
impl<T: ?Sized> Unpin for ContiguousMemoryRef<T>where T: Unpin,
impl<T> !UnwindSafe for ContiguousMemoryRef<T>
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