pub unsafe trait WrapRaw: Sized {
type Raw;
fn raw(&self) -> &Self::Raw { ... }
unsafe fn raw_mut(&mut self) -> &mut Self::Raw { ... }
unsafe fn wrap(raw: &Self::Raw) -> &Self { ... }
unsafe fn wrap_mut(raw: &mut Self::Raw) -> &mut Self { ... }
unsafe fn wrap_ptr<'a>(ptr: *const Self::Raw) -> Option<&'a Self> { ... }
unsafe fn wrap_ptr_mut<'a>(ptr: *mut Self::Raw) -> Option<&'a mut Self> { ... }
}
Expand description
Safe wrapper around a raw il2cpp type which can be used in its place
Safety
The wrapper must have the exact same representation as the underlying raw
il2cpp type, which means it has to be #[repr(transparent)]
.
Required Associated Types
Provided Methods
Returns a mutable reference to the underlying raw il2cpp type
Safety
This method is unsafe because it allows mutating the underlying type in ways that make it invalid. Avoid mutating raw il2cpp types unless you know exactly what you are doing.
Wraps a const pointer to the raw il2cpp type
Safety
The pointer must not be dangling and must stay valid for the lifetime of the returned reference if it is not null, and the wrapped type must be in a valid state.