#[repr(C)]pub struct UserStringView {
pub data: UserInPtr<u8>,
pub length: usize,
}Expand description
A wrapper around zx_string_view_t passed from userspace into kernel syscalls.
This struct has exact memory layout parity with zx_string_view_t (const char*, size_t),
ensuring ABI compatibility when passed by value across FFI boundaries.
Fields§
§data: UserInPtr<u8>Pointer to userspace UTF-8 bytes.
length: usizeLength of the string in bytes.
Implementations§
Source§impl UserStringView
impl UserStringView
Sourcepub fn copy_slice_from_user<'a>(
&self,
dst: &'a mut [MaybeUninit<u8>],
) -> Result<&'a mut [u8], Status>
pub fn copy_slice_from_user<'a>( &self, dst: &'a mut [MaybeUninit<u8>], ) -> Result<&'a mut [u8], Status>
Copies the string bytes from userspace into a destination slice.
Returns Status::INVALID_ARGS if the slice is smaller than length.
Trait Implementations§
Source§impl Clone for UserStringView
impl Clone for UserStringView
Source§fn clone(&self) -> UserStringView
fn clone(&self) -> UserStringView
Returns a duplicate of the value. Read more
1.0.0 (const: unstable)§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UserStringView
impl Debug for UserStringView
Source§impl Default for UserStringView
impl Default for UserStringView
Source§fn default() -> UserStringView
fn default() -> UserStringView
Returns the “default value” for a type. Read more
impl Copy for UserStringView
Auto Trait Implementations§
impl Freeze for UserStringView
impl RefUnwindSafe for UserStringView
impl !Send for UserStringView
impl !Sync for UserStringView
impl Unpin for UserStringView
impl UnsafeUnpin for UserStringView
impl UnwindSafe for UserStringView
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)