Struct User

Source
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>

Source

pub fn new_in(from: *const T, address_space: &AddressSpace) -> Self

🔬This is a nightly-only experimental API. (kernel_ptr)
Source

pub fn is_null(self) -> bool

🔬This is a nightly-only experimental API. (kernel_ptr)
Source

pub fn cast<U>(self) -> User<*const U>

🔬This is a nightly-only experimental API. (kernel_ptr)
Source

pub fn cast_mut(self) -> User<*mut T>

🔬This is a nightly-only experimental API. (kernel_ptr)
Source§

impl<T: ?Sized> User<*mut T>

Source

pub fn new_in(from: *mut T, address_space: &AddressSpace) -> Self

🔬This is a nightly-only experimental API. (kernel_ptr)
Source

pub fn is_null(self) -> bool

🔬This is a nightly-only experimental API. (kernel_ptr)
Source

pub fn cast<U>(self) -> User<*mut U>

🔬This is a nightly-only experimental API. (kernel_ptr)
Source

pub fn cast_const(self) -> User<*const T>

🔬This is a nightly-only experimental API. (kernel_ptr)
Source§

impl<T> User<*const T>

Source

pub unsafe fn read(self) -> Result<T, PointerError>

🔬This is a nightly-only experimental API. (kernel_ptr)
§Safety

The memory pointed to must be valid for a read of T

Source

pub unsafe fn read_unaligned(self) -> Result<T, PointerError>

🔬This is a nightly-only experimental API. (kernel_ptr)
§Safety

The memory pointed to must be valid for a read of T

Source

pub unsafe fn copy_to_nonoverlapping( self, dest: *mut T, count: usize, ) -> Result<(), PointerError>

🔬This is a nightly-only experimental API. (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]

Source

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>

Source

pub unsafe fn read(self) -> Result<T, PointerError>

🔬This is a nightly-only experimental API. (kernel_ptr)
§Safety

The memory pointed to must be valid for a read of T

Source

pub unsafe fn read_unaligned(self) -> Result<T, PointerError>

🔬This is a nightly-only experimental API. (kernel_ptr)
§Safety

The memory pointed to must be valid for a read of T

Source

pub unsafe fn copy_to_nonoverlapping( self, dest: *mut T, count: usize, ) -> Result<(), PointerError>

🔬This is a nightly-only experimental API. (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]

Source

pub fn copy_to_user( self, dest: User<*mut T>, _count: usize, ) -> Result<(), PointerError>

🔬This is a nightly-only experimental API. (kernel_ptr)
Source

pub fn write(self, val: T) -> Result<(), PointerError>

🔬This is a nightly-only experimental API. (kernel_ptr)
Source

pub fn write_unaligned(self, _val: T) -> Result<(), PointerError>

🔬This is a nightly-only experimental API. (kernel_ptr)
Source

pub fn copy_from_nonoverlapping( self, src: *const T, count: usize, ) -> Result<(), PointerError>

🔬This is a nightly-only experimental API. (kernel_ptr)
§Safety

src must be valid for a read of T as defined by [core::ptr::read]

Source

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]>

Source

pub unsafe fn read_to_buffer(self) -> Result<Box<[T]>, PointerError>

🔬This is a nightly-only experimental API. (kernel_ptr)
§Safety

The memory pointed to must be valid for a read of [T]

Source

pub fn is_empty(self) -> bool

🔬This is a nightly-only experimental API. (kernel_ptr)
Source

pub fn len(self) -> usize

🔬This is a nightly-only experimental API. (kernel_ptr)
Source§

impl<T> User<*mut [T]>

Source

pub unsafe fn read_to_buffer(self) -> Result<Box<[T]>, PointerError>

🔬This is a nightly-only experimental API. (kernel_ptr)
§Safety

The memory pointed to must be valid for a read of [T]

Source

pub fn is_empty(self) -> bool

🔬This is a nightly-only experimental API. (kernel_ptr)
Source

pub fn len(self) -> usize

🔬This is a nightly-only experimental API. (kernel_ptr)
Source

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 T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.