pub struct Reference<V: ?Sized, M: MemoryView> { /* private fields */ }Expand description
A reference to an object living in the underlying memory view.
Implementations§
Source§impl<T: ?Sized, M: MemoryView> Reference<T, M>
impl<T: ?Sized, M: MemoryView> Reference<T, M>
Source§impl<T: Viewable, M: MemoryView> Reference<T, M>
impl<T: Viewable, M: MemoryView> Reference<T, M>
pub fn read_field<R: FromMemoryView, C>(
&self,
field: &TypedViewableField<C, R>,
) -> Result<R, MemoryDecodeError<M::AccessError, R::DecodeError>>where
T: ViewableExtends<C>,
pub fn reference_field<R, C>(
&self,
field: &TypedViewableField<C, R>,
) -> Reference<R, &M>where
T: ViewableExtends<C>,
Source§impl<T: Viewable, M: MemoryView> Reference<T, M>where
for<'a> &'a M: MemoryViewDereferenceable,
impl<T: Viewable, M: MemoryView> Reference<T, M>where
for<'a> &'a M: MemoryViewDereferenceable,
pub fn dereference_field<R: ?Sized, C>(
&self,
field: &TypedViewableField<C, Ptr64<R>>,
) -> Result<Reference<R, &M>, <&M as MemoryView>::AccessError>where
T: ViewableExtends<C>,
Source§impl<T: ?Sized, M: MemoryViewDereferenceable> Reference<Ptr64<T>, M>
impl<T: ?Sized, M: MemoryViewDereferenceable> Reference<Ptr64<T>, M>
pub fn dereference(self) -> Result<Reference<T, M>, M::AccessError>
Source§impl<T: FromMemoryView, M: MemoryView> Reference<T, M>
impl<T: FromMemoryView, M: MemoryView> Reference<T, M>
pub fn read( &self, ) -> Result<T, MemoryDecodeError<M::AccessError, T::DecodeError>>
Source§impl<T: ViewableSized, M: MemoryView> Reference<T, M>
impl<T: ViewableSized, M: MemoryView> Reference<T, M>
pub fn create_copy(&self) -> Result<Copy<T>, M::AccessError>
Source§impl<T: CopyConstructable, M: MemoryView> Reference<[T], M>
impl<T: CopyConstructable, M: MemoryView> Reference<[T], M>
pub fn read_element(&self, index: usize) -> Result<T, M::AccessError>
Source§impl<T: ViewableSized, M: MemoryView> Reference<[T], M>
impl<T: ViewableSized, M: MemoryView> Reference<[T], M>
pub fn reference_element(&self, index: usize) -> Reference<T, &M>
pub fn copy_element(&self, index: usize) -> Result<Copy<T>, M::AccessError>
Source§impl<T: CopyConstructable, M: MemoryView, const N: usize> Reference<[T; N], M>
impl<T: CopyConstructable, M: MemoryView, const N: usize> Reference<[T; N], M>
pub fn read_element(&self, index: usize) -> Result<T, M::AccessError>
pub fn read_elements(&self) -> Result<Vec<T>, M::AccessError>
Source§impl<T: ViewableSized, M: MemoryView, const N: usize> Reference<[T; N], M>
impl<T: ViewableSized, M: MemoryView, const N: usize> Reference<[T; N], M>
pub fn reference_element(&self, index: usize) -> Reference<T, &M>
pub fn reference_elements(&self) -> Vec<Reference<T, &M>>
pub fn copy_element(&self, index: usize) -> Result<Copy<T>, M::AccessError>
pub fn copy_elements(&self) -> Result<Vec<Copy<T>>, M::AccessError>
Trait Implementations§
Auto Trait Implementations§
impl<V, M> Freeze for Reference<V, M>
impl<V, M> RefUnwindSafe for Reference<V, M>
impl<V, M> Send for Reference<V, M>
impl<V, M> Sync for Reference<V, M>
impl<V, M> Unpin for Reference<V, M>
impl<V, M> UnwindSafe for Reference<V, M>
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