pub struct DynamicManagedRef { /* private fields */ }
Implementations§
source§impl DynamicManagedRef
impl DynamicManagedRef
pub fn new<T>(data: &T, lifetime: LifetimeRef) -> DynamicManagedRefwhere
T: ?Sized,
sourcepub unsafe fn new_raw(
type_hash: TypeHash,
lifetime: LifetimeRef,
data: *const u8,
) -> Option<DynamicManagedRef>
pub unsafe fn new_raw( type_hash: TypeHash, lifetime: LifetimeRef, data: *const u8, ) -> Option<DynamicManagedRef>
§Safety
pub fn make<T>(data: &T) -> (DynamicManagedRef, Lifetime)where
T: ?Sized,
pub fn into_inner(self) -> (TypeHash, LifetimeRef, *const u8)
pub fn into_typed<T>(self) -> Result<ManagedRef<T>, DynamicManagedRef>
pub fn type_hash(&self) -> &TypeHash
pub fn lifetime(&self) -> &LifetimeRef
pub fn borrow(&self) -> Option<DynamicManagedRef>
pub fn is<T>(&self) -> bool
pub fn read<T>(&self) -> Option<ValueReadAccess<'_, T>>
sourcepub unsafe fn map<T, U>(
self,
f: impl FnOnce(&T) -> &U,
) -> Option<DynamicManagedRef>
pub unsafe fn map<T, U>( self, f: impl FnOnce(&T) -> &U, ) -> Option<DynamicManagedRef>
§Safety
Trait Implementations§
source§impl From<DynamicManagedRef> for DynamicManagedValue
impl From<DynamicManagedRef> for DynamicManagedValue
source§fn from(value: DynamicManagedRef) -> DynamicManagedValue
fn from(value: DynamicManagedRef) -> DynamicManagedValue
Converts to this type from the input type.
source§impl TryFrom<DynamicManagedValue> for DynamicManagedRef
impl TryFrom<DynamicManagedValue> for DynamicManagedRef
source§fn try_from(
value: DynamicManagedValue,
) -> Result<DynamicManagedRef, <DynamicManagedRef as TryFrom<DynamicManagedValue>>::Error>
fn try_from( value: DynamicManagedValue, ) -> Result<DynamicManagedRef, <DynamicManagedRef as TryFrom<DynamicManagedValue>>::Error>
Performs the conversion.
impl Send for DynamicManagedRef
impl Sync for DynamicManagedRef
Auto Trait Implementations§
impl Freeze for DynamicManagedRef
impl RefUnwindSafe for DynamicManagedRef
impl Unpin for DynamicManagedRef
impl UnwindSafe for DynamicManagedRef
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