pub struct Copy<V: ViewableSized> { /* private fields */ }Expand description
A Copy represents an owned copy of the struct binary contents
Implementations§
Source§impl<V: ViewableSized> Copy<V>
impl<V: ViewableSized> Copy<V>
pub fn new(inner: V::Memory) -> Self
Sourcepub unsafe fn new_zerod() -> Self
pub unsafe fn new_zerod() -> Self
§Safety
Creating a new instance of the target object based of zeros can lead to undefined behaviour as the internal state of the object may be invalid.
pub fn read_from_memory<M: MemoryView>( memory: &M, offset: u64, ) -> Result<Self, M::AccessError>
Methods from Deref<Target = Reference<V, CopyMemory<V::Memory>>>§
pub fn memory_address(&self) -> u64
pub fn memory(&self) -> &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>,
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>,
pub fn read( &self, ) -> Result<T, MemoryDecodeError<M::AccessError, T::DecodeError>>
pub fn create_copy(&self) -> Result<Copy<T>, M::AccessError>
Trait Implementations§
Source§impl<V: ViewableSized> Deref for Copy<V>
impl<V: ViewableSized> Deref for Copy<V>
Source§impl<V: ViewableSized> DerefMut for Copy<V>
impl<V: ViewableSized> DerefMut for Copy<V>
Source§impl<V: ViewableSized> FromMemoryView for Copy<V>
impl<V: ViewableSized> FromMemoryView for Copy<V>
type DecodeError = Infallible
fn read_object<M: MemoryView>( view: &M, offset: u64, ) -> Result<Self, MemoryDecodeError<M::AccessError, Self::DecodeError>>
Auto Trait Implementations§
impl<V> Freeze for Copy<V>
impl<V> RefUnwindSafe for Copy<V>
impl<V> Send for Copy<V>
impl<V> Sync for Copy<V>
impl<V> Unpin for Copy<V>
impl<V> UnwindSafe for Copy<V>
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