Lines Matching refs:ptr
63 pub fn read<T>(&self, ptr: GuestPtr<T>) -> Result<T, GuestError> in read()
67 T::read(self, ptr) in read()
79 pub fn write<T>(&mut self, ptr: GuestPtr<T>, val: T) -> Result<(), GuestError> in write()
83 T::write(self, ptr, val) in write()
96 pub fn as_cow(&self, ptr: GuestPtr<[u8]>) -> Result<Cow<'_, [u8]>, GuestError> { in as_cow()
98 GuestMemory::Unshared(_) => match self.as_slice(ptr)? { in as_cow()
102 GuestMemory::Shared(_) => Ok(Cow::Owned(self.to_vec(ptr)?)), in as_cow()
112 pub fn as_cow_str(&self, ptr: GuestPtr<str>) -> Result<Cow<'_, str>, GuestError> { in as_cow_str()
113 match self.as_cow(ptr.cast::<[u8]>())? { in as_cow_str()
131 pub fn as_slice(&self, ptr: GuestPtr<[u8]>) -> Result<Option<&[u8]>, GuestError> { in as_slice()
132 let range = self.validate_range::<u8>(ptr.pointer.0, ptr.pointer.1)?; in as_slice()
140 pub fn as_str(&self, ptr: GuestPtr<str>) -> Result<Option<&str>, GuestError> { in as_str()
141 match self.as_slice(ptr.cast())? { in as_str()
152 pub fn as_slice_mut(&mut self, ptr: GuestPtr<[u8]>) -> Result<Option<&mut [u8]>, GuestError> { in as_slice_mut()
153 let range = self.validate_range::<u8>(ptr.pointer.0, ptr.pointer.1)?; in as_slice_mut()
164 pub fn to_vec<T>(&self, ptr: GuestPtr<[T]>) -> Result<Vec<T>, GuestError> in to_vec()
168 let guest = self.validate_size_align::<T>(ptr.pointer.0, ptr.pointer.1)?; in to_vec()
182 std::ptr::copy(guest.as_ptr().cast(), host.as_mut_ptr(), guest.len()); in to_vec()
200 pub fn copy_from_slice<T>(&mut self, slice: &[T], ptr: GuestPtr<[T]>) -> Result<(), GuestError> in copy_from_slice()
204 if usize::try_from(ptr.len())? != slice.len() { in copy_from_slice()
211 let guest = self.validate_size_align::<T>(ptr.pointer.0, ptr.pointer.1)?; in copy_from_slice()
225 std::ptr::copy(slice.as_ptr(), guest, slice.len()); in copy_from_slice()
584 unsafe fn clone(ptr: *const ()) -> RawWaker { in run_in_dummy_executor()
585 assert_eq!(ptr as usize, 5); in run_in_dummy_executor()
587 RawWaker::new(ptr, &VTABLE) in run_in_dummy_executor()
590 unsafe fn wake(ptr: *const ()) { in run_in_dummy_executor()
591 assert_eq!(ptr as usize, 5); in run_in_dummy_executor()
594 unsafe fn wake_by_ref(ptr: *const ()) { in run_in_dummy_executor()
595 assert_eq!(ptr as usize, 5); in run_in_dummy_executor()
598 unsafe fn drop(ptr: *const ()) { in run_in_dummy_executor()
599 assert_eq!(ptr as usize, 5); in run_in_dummy_executor()