pub struct DynamicManaged { /* private fields */ }
Implementations§
source§impl DynamicManaged
impl DynamicManaged
pub fn new<T>(data: T) -> Result<DynamicManaged, T>where
T: Finalize,
pub fn new_raw( type_hash: TypeHash, lifetime: Lifetime, memory: *mut u8, layout: Layout, finalizer: unsafe fn(_: *mut ()), ) -> Option<DynamicManaged>
sourcepub unsafe fn from_bytes(
type_hash: TypeHash,
lifetime: Lifetime,
bytes: Vec<u8>,
layout: Layout,
finalizer: unsafe fn(_: *mut ()),
) -> DynamicManaged
pub unsafe fn from_bytes( type_hash: TypeHash, lifetime: Lifetime, bytes: Vec<u8>, layout: Layout, finalizer: unsafe fn(_: *mut ()), ) -> DynamicManaged
§Safety
pub fn into_inner( self, ) -> (TypeHash, Lifetime, *mut u8, Layout, unsafe fn(_: *mut ()))
pub fn into_typed<T>(self) -> Result<Managed<T>, DynamicManaged>
pub fn renew(self) -> DynamicManaged
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, DynamicManaged>
pub fn borrow(&self) -> Option<DynamicManagedRef>
pub fn borrow_mut(&mut self) -> Option<DynamicManagedRefMut>
pub fn lazy(&self) -> DynamicManagedLazy
sourcepub unsafe fn map<T, U>(self, f: impl FnOnce(T) -> U) -> Option<DynamicManaged>where
U: Finalize,
pub unsafe fn map<T, U>(self, f: impl FnOnce(T) -> U) -> Option<DynamicManaged>where
U: Finalize,
§Safety
sourcepub unsafe fn try_map<T, U>(
self,
f: impl FnOnce(T) -> Option<U>,
) -> Option<DynamicManaged>where
U: Finalize,
pub unsafe fn try_map<T, U>(
self,
f: impl FnOnce(T) -> Option<U>,
) -> Option<DynamicManaged>where
U: Finalize,
§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
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) -> DynamicManagedValue
fn from(value: DynamicManaged) -> DynamicManagedValue
Converts to this type from the input type.
source§impl TryFrom<DynamicManagedValue> for DynamicManaged
impl TryFrom<DynamicManagedValue> for DynamicManaged
source§fn try_from(
value: DynamicManagedValue,
) -> Result<DynamicManaged, <DynamicManaged as TryFrom<DynamicManagedValue>>::Error>
fn try_from( value: DynamicManagedValue, ) -> Result<DynamicManaged, <DynamicManaged as TryFrom<DynamicManagedValue>>::Error>
Performs the conversion.
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