pub struct User<T>(T, NonNull<AddressSpaceInner>);
🔬This is a nightly-only experimental API. (
kernel_ptr
)Tuple Fields§
§0: T
🔬This is a nightly-only experimental API. (
§kernel_ptr
)1: NonNull<AddressSpaceInner>
🔬This is a nightly-only experimental API. (
kernel_ptr
)Implementations§
Source§impl<T: ?Sized> User<*const T>
impl<T: ?Sized> User<*const T>
pub fn new_in(from: *const T, address_space: &AddressSpace) -> Self
🔬This is a nightly-only experimental API. (
kernel_ptr
)pub fn is_null(self) -> bool
🔬This is a nightly-only experimental API. (
kernel_ptr
)pub fn cast<U>(self) -> User<*const U>
🔬This is a nightly-only experimental API. (
kernel_ptr
)pub fn cast_mut(self) -> User<*mut T>
🔬This is a nightly-only experimental API. (
kernel_ptr
)Source§impl<T: ?Sized> User<*mut T>
impl<T: ?Sized> User<*mut T>
pub fn new_in(from: *mut T, address_space: &AddressSpace) -> Self
🔬This is a nightly-only experimental API. (
kernel_ptr
)pub fn is_null(self) -> bool
🔬This is a nightly-only experimental API. (
kernel_ptr
)pub fn cast<U>(self) -> User<*mut U>
🔬This is a nightly-only experimental API. (
kernel_ptr
)pub fn cast_const(self) -> User<*const T>
🔬This is a nightly-only experimental API. (
kernel_ptr
)Source§impl<T> User<*const T>
impl<T> User<*const T>
Sourcepub unsafe fn read(self) -> Result<T, PointerError>
🔬This is a nightly-only experimental API. (kernel_ptr
)
pub unsafe fn read(self) -> Result<T, PointerError>
kernel_ptr
)§Safety
The memory pointed to must be valid for a read of T
Sourcepub unsafe fn read_unaligned(self) -> Result<T, PointerError>
🔬This is a nightly-only experimental API. (kernel_ptr
)
pub unsafe fn read_unaligned(self) -> Result<T, PointerError>
kernel_ptr
)§Safety
The memory pointed to must be valid for a read of T
Sourcepub unsafe fn copy_to_nonoverlapping(
self,
dest: *mut T,
count: usize,
) -> Result<(), PointerError>
🔬This is a nightly-only experimental API. (kernel_ptr
)
pub unsafe fn copy_to_nonoverlapping( self, dest: *mut T, count: usize, ) -> Result<(), PointerError>
kernel_ptr
)§Safety
The memory pointed to must be valid for a read of T
dest
must be valid to write to as defined by [core::ptr::write
]
pub fn copy_to_user( self, dest: User<*mut T>, _count: usize, ) -> Result<(), PointerError>
🔬This is a nightly-only experimental API. (
kernel_ptr
)Source§impl<T> User<*mut T>
impl<T> User<*mut T>
Sourcepub unsafe fn read(self) -> Result<T, PointerError>
🔬This is a nightly-only experimental API. (kernel_ptr
)
pub unsafe fn read(self) -> Result<T, PointerError>
kernel_ptr
)§Safety
The memory pointed to must be valid for a read of T
Sourcepub unsafe fn read_unaligned(self) -> Result<T, PointerError>
🔬This is a nightly-only experimental API. (kernel_ptr
)
pub unsafe fn read_unaligned(self) -> Result<T, PointerError>
kernel_ptr
)§Safety
The memory pointed to must be valid for a read of T
Sourcepub unsafe fn copy_to_nonoverlapping(
self,
dest: *mut T,
count: usize,
) -> Result<(), PointerError>
🔬This is a nightly-only experimental API. (kernel_ptr
)
pub unsafe fn copy_to_nonoverlapping( self, dest: *mut T, count: usize, ) -> Result<(), PointerError>
kernel_ptr
)§Safety
The memory pointed to must be valid for a read of T
dest
must be valid to write to as defined by [core::ptr::write
]
pub fn copy_to_user( self, dest: User<*mut T>, _count: usize, ) -> Result<(), PointerError>
🔬This is a nightly-only experimental API. (
kernel_ptr
)pub fn write(self, val: T) -> Result<(), PointerError>
🔬This is a nightly-only experimental API. (
kernel_ptr
)pub fn write_unaligned(self, _val: T) -> Result<(), PointerError>
🔬This is a nightly-only experimental API. (
kernel_ptr
)Sourcepub fn copy_from_nonoverlapping(
self,
src: *const T,
count: usize,
) -> Result<(), PointerError>
🔬This is a nightly-only experimental API. (kernel_ptr
)
pub fn copy_from_nonoverlapping( self, src: *const T, count: usize, ) -> Result<(), PointerError>
kernel_ptr
)§Safety
src
must be valid for a read of T
as defined by [core::ptr::read
]
pub fn copy_from_user( self, src: User<*const T>, count: usize, ) -> Result<(), PointerError>
🔬This is a nightly-only experimental API. (
kernel_ptr
)Source§impl<T> User<*const [T]>
impl<T> User<*const [T]>
Sourcepub unsafe fn read_to_buffer(self) -> Result<Box<[T]>, PointerError>
🔬This is a nightly-only experimental API. (kernel_ptr
)
pub unsafe fn read_to_buffer(self) -> Result<Box<[T]>, PointerError>
kernel_ptr
)§Safety
The memory pointed to must be valid for a read of [T]
pub fn is_empty(self) -> bool
🔬This is a nightly-only experimental API. (
kernel_ptr
)pub fn len(self) -> usize
🔬This is a nightly-only experimental API. (
kernel_ptr
)Source§impl<T> User<*mut [T]>
impl<T> User<*mut [T]>
Sourcepub unsafe fn read_to_buffer(self) -> Result<Box<[T]>, PointerError>
🔬This is a nightly-only experimental API. (kernel_ptr
)
pub unsafe fn read_to_buffer(self) -> Result<Box<[T]>, PointerError>
kernel_ptr
)§Safety
The memory pointed to must be valid for a read of [T]
pub fn is_empty(self) -> bool
🔬This is a nightly-only experimental API. (
kernel_ptr
)pub fn len(self) -> usize
🔬This is a nightly-only experimental API. (
kernel_ptr
)pub fn write_from_buffer(self, val: &[T]) -> Result<usize, PointerError>
🔬This is a nightly-only experimental API. (
kernel_ptr
)Auto Trait Implementations§
impl<T> Freeze for User<T>where
T: Freeze,
impl<T> !RefUnwindSafe for User<T>
impl<T> !Send for User<T>
impl<T> !Sync for User<T>
impl<T> Unpin for User<T>where
T: Unpin,
impl<T> !UnwindSafe for User<T>
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