[−][src]Trait std::os::fortanix_sgx::usercalls::alloc::UserSafe
A type that can be represented in memory as one or more UserSafeSized
s.
Required methods
fn align_of() -> usize
Equivalent to mem::align_of::<Self>
.
unsafe fn from_raw_sized_unchecked(ptr: *mut u8, size: usize) -> *mut Self
Construct a pointer to Self
given a memory range in user space.
N.B., this takes a size, not a length!
Safety
The caller must ensure the memory range is in user memory, is the correct size and is correctly aligned and points to the right type.
Provided methods
unsafe fn from_raw_sized(ptr: *mut u8, size: usize) -> NonNull<Self>
Construct a pointer to Self
given a memory range.
N.B., this takes a size, not a length!
Safety
The caller must ensure the memory range points to the correct type.
Panics
This function panics if:
- the pointer is not aligned.
- the pointer is null.
- the pointed-to range does not fit in the address space.
- the pointed-to range is not in user memory.