pub struct UserSliceWrite { /* private fields */ }Expand description
A validated writable reference to a user-space memory region.
Construction validates that [ptr, ptr+len) is mapped, user-accessible,
and writable. After construction, the kernel can safely write to this region.
Implementations§
Source§impl UserSliceWrite
impl UserSliceWrite
Sourcepub fn new(ptr: u64, len: usize) -> Result<Self, UserSliceError>
pub fn new(ptr: u64, len: usize) -> Result<Self, UserSliceError>
Create a new validated writable user slice.
Fails if:
ptris nullptr + lenoverflows or crosses into kernel space- Any page in the range is not mapped, not user-accessible, or not writable
Auto Trait Implementations§
impl Freeze for UserSliceWrite
impl RefUnwindSafe for UserSliceWrite
impl Send for UserSliceWrite
impl Sync for UserSliceWrite
impl Unpin for UserSliceWrite
impl UnsafeUnpin for UserSliceWrite
impl UnwindSafe for UserSliceWrite
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more