pub struct DynamicManaged { /* private fields */ }
Implementations§
Source§impl DynamicManaged
impl DynamicManaged
pub fn new<T: Finalize>(data: T) -> Result<Self, T>
pub fn new_raw( type_hash: TypeHash, lifetime: Lifetime, memory: *mut u8, layout: Layout, finalizer: unsafe fn(_: *mut ()), ) -> Option<Self>
Sourcepub unsafe fn from_bytes(
type_hash: TypeHash,
lifetime: Lifetime,
bytes: Vec<u8>,
layout: Layout,
finalizer: unsafe fn(_: *mut ()),
) -> Self
pub unsafe fn from_bytes( type_hash: TypeHash, lifetime: Lifetime, bytes: Vec<u8>, layout: Layout, finalizer: unsafe fn(_: *mut ()), ) -> Self
§Safety
pub fn into_inner( self, ) -> (TypeHash, Lifetime, *mut u8, Layout, unsafe fn(_: *mut ()))
pub fn into_typed<T>(self) -> Result<Managed<T>, Self>
pub fn renew(self) -> Self
pub fn type_hash(&self) -> &TypeHash
pub fn lifetime(&self) -> &Lifetime
Sourcepub unsafe fn memory_mut(&mut self) -> &mut [u8] ⓘ
pub unsafe fn memory_mut(&mut self) -> &mut [u8] ⓘ
§Safety
pub fn is<T>(&self) -> bool
pub fn read<T>(&self) -> Option<ValueReadAccess<'_, T>>
pub fn write<T>(&mut self) -> Option<ValueWriteAccess<'_, T>>
pub fn consume<T>(self) -> Result<T, Self>
pub fn move_into_ref(self, target: DynamicManagedRefMut) -> Result<(), Self>
pub fn move_into_lazy(self, target: DynamicManagedLazy) -> Result<(), Self>
pub fn borrow(&self) -> Option<DynamicManagedRef>
pub fn borrow_mut(&mut self) -> Option<DynamicManagedRefMut>
pub fn lazy(&self) -> DynamicManagedLazy
Sourcepub unsafe fn try_map<T, U: Finalize>(
self,
f: impl FnOnce(T) -> Option<U>,
) -> Option<Self>
pub unsafe fn try_map<T, U: Finalize>( self, f: impl FnOnce(T) -> Option<U>, ) -> Option<Self>
§Safety
Sourcepub unsafe fn as_mut_ptr<T>(&mut self) -> Option<*mut T>
pub unsafe fn as_mut_ptr<T>(&mut self) -> Option<*mut T>
§Safety
Sourcepub unsafe fn as_ptr_raw(&self) -> *const u8
pub unsafe fn as_ptr_raw(&self) -> *const u8
§Safety
Sourcepub unsafe fn as_mut_ptr_raw(&mut self) -> *mut u8
pub unsafe fn as_mut_ptr_raw(&mut self) -> *mut u8
§Safety
Trait Implementations§
Source§impl Drop for DynamicManaged
impl Drop for DynamicManaged
Source§impl From<DynamicManaged> for DynamicManagedValue
impl From<DynamicManaged> for DynamicManagedValue
Source§fn from(value: DynamicManaged) -> Self
fn from(value: DynamicManaged) -> Self
Converts to this type from the input type.
Source§impl TryFrom<DynamicManagedValue> for DynamicManaged
impl TryFrom<DynamicManagedValue> for DynamicManaged
impl Send for DynamicManaged
impl Sync for DynamicManaged
Auto Trait Implementations§
impl Freeze for DynamicManaged
impl RefUnwindSafe for DynamicManaged
impl Unpin for DynamicManaged
impl UnwindSafe for DynamicManaged
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