pub struct MyStruct { /* private fields */ }Implementations§
Source§impl MyStruct
impl MyStruct
pub fn from(p: *mut u8, l: usize) -> MyStruct
Sourcepub unsafe fn get(&self) -> &mut [u8] ⓘ
pub unsafe fn get(&self) -> &mut [u8] ⓘ
§Safety
-
NonNull: pointer
self.ptrmust not be null -
ValidPtr: pointer
self.ptrmust be valid for reading and writing thesizeof(u8)*self.lenmemory from it -
Init: the memory range
[self.ptr, self.ptr + sizeof(u8)*self.len]must be fully initialized for typeu8 -
Alive: the reference of
self.ptrmust outlive the lifetime_ -
Alias:
self.ptrmust not have other alias -
Align: pointer
self.ptrmust be properly aligned for typeu8 -
ValidNum: the value of
self.len * sizeof(u8)must lie within the valid[0, isize :: MAX]
Auto Trait Implementations§
impl Freeze for MyStruct
impl RefUnwindSafe for MyStruct
impl !Send for MyStruct
impl !Sync for MyStruct
impl Unpin for MyStruct
impl UnwindSafe for MyStruct
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