pub struct UserInPtr<T> { /* private fields */ }Expand description
A wrapper around a const pointer to user memory.
Implementations§
Source§impl<T> UserInPtr<T>
impl<T> UserInPtr<T>
Sourcepub fn byte_offset(&self, count: isize) -> Self
pub fn byte_offset(&self, count: isize) -> Self
Returns a pointer offset by count bytes.
Sourcepub fn element_offset(&self, index: usize) -> Self
pub fn element_offset(&self, index: usize) -> Self
Returns a pointer offset by index elements.
Sourcepub fn reinterpret<U>(&self) -> UserInPtr<U>
pub fn reinterpret<U>(&self) -> UserInPtr<U>
Reinterprets the pointer as a pointer to type U.
Sourcepub fn copy_from_user<'a>(
&self,
dst: &'a mut MaybeUninit<T>,
) -> Result<&'a mut T, Status>
pub fn copy_from_user<'a>( &self, dst: &'a mut MaybeUninit<T>, ) -> Result<&'a mut T, Status>
Copies a single element from userspace into dst.
Sourcepub fn read(&self) -> Result<T, Status>
pub fn read(&self) -> Result<T, Status>
Reads and returns a single copyable element from userspace.
Sourcepub fn copy_slice_from_user<'a>(
&self,
dst: &'a mut [MaybeUninit<T>],
) -> Result<&'a mut [T], Status>
pub fn copy_slice_from_user<'a>( &self, dst: &'a mut [MaybeUninit<T>], ) -> Result<&'a mut [T], Status>
Copies a slice of elements from userspace into dst.
Trait Implementations§
impl<T: Copy> Copy for UserInPtr<T>
Auto Trait Implementations§
impl<T> Freeze for UserInPtr<T>
impl<T> RefUnwindSafe for UserInPtr<T>where
T: RefUnwindSafe,
impl<T> !Send for UserInPtr<T>
impl<T> !Sync for UserInPtr<T>
impl<T> Unpin for UserInPtr<T>
impl<T> UnsafeUnpin for UserInPtr<T>
impl<T> UnwindSafe for UserInPtr<T>where
T: RefUnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)