pub struct UserConstPtr<T>(/* private fields */);
Expand description
An immutable pointer to user space memory.
Implementations§
Source§impl<T> UserConstPtr<T>
impl<T> UserConstPtr<T>
pub fn address(&self) -> VirtAddr
pub fn is_null(&self) -> bool
pub fn get_as_ref(self) -> LinuxResult<&'static T>
pub fn get_as_slice(self, len: usize) -> LinuxResult<&'static [T]>
pub fn get_as_null_terminated(self) -> LinuxResult<&'static [T]>
Source§impl UserConstPtr<c_char>
impl UserConstPtr<c_char>
Sourcepub fn get_as_str(self) -> LinuxResult<&'static str>
pub fn get_as_str(self) -> LinuxResult<&'static str>
Get the pointer as &str
, validating the memory region.
Trait Implementations§
Source§impl<T: Clone> Clone for UserConstPtr<T>
impl<T: Clone> Clone for UserConstPtr<T>
Source§fn clone(&self) -> UserConstPtr<T>
fn clone(&self) -> UserConstPtr<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T> Default for UserConstPtr<T>
impl<T> Default for UserConstPtr<T>
Source§impl<T> From<usize> for UserConstPtr<T>
impl<T> From<usize> for UserConstPtr<T>
Source§impl<T: PartialEq> PartialEq for UserConstPtr<T>
impl<T: PartialEq> PartialEq for UserConstPtr<T>
impl<T: Copy> Copy for UserConstPtr<T>
impl<T> StructuralPartialEq for UserConstPtr<T>
Auto Trait Implementations§
impl<T> Freeze for UserConstPtr<T>
impl<T> RefUnwindSafe for UserConstPtr<T>where
T: RefUnwindSafe,
impl<T> !Send for UserConstPtr<T>
impl<T> !Sync for UserConstPtr<T>
impl<T> Unpin for UserConstPtr<T>
impl<T> UnwindSafe for UserConstPtr<T>where
T: RefUnwindSafe,
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