pub enum ManagedValue<T> {
Owned(Managed<T>),
Ref(ManagedRef<T>),
RefMut(ManagedRefMut<T>),
Lazy(ManagedLazy<T>),
}
Variants§
Implementations§
source§impl<T> ManagedValue<T>
impl<T> ManagedValue<T>
pub fn as_owned(&self) -> Option<&Managed<T>>
pub fn as_mut_owned(&mut self) -> Option<&mut Managed<T>>
pub fn as_ref(&self) -> Option<&ManagedRef<T>>
pub fn as_mut_ref(&mut self) -> Option<&mut ManagedRef<T>>
pub fn as_ref_mut(&self) -> Option<&ManagedRefMut<T>>
pub fn as_mut_ref_mut(&mut self) -> Option<&mut ManagedRefMut<T>>
pub fn as_lazy(&self) -> Option<&ManagedLazy<T>>
pub fn as_mut_lazy(&mut self) -> Option<&mut ManagedLazy<T>>
pub fn read(&self) -> Option<ValueReadAccess<'_, T>>
pub fn write(&mut self) -> Option<ValueWriteAccess<'_, T>>
pub fn borrow(&self) -> Option<ManagedRef<T>>
pub fn borrow_mut(&mut self) -> Option<ManagedRefMut<T>>
pub fn lazy(&mut self) -> Option<ManagedLazy<T>>
Trait Implementations§
source§impl<T> From<Managed<T>> for ManagedValue<T>
impl<T> From<Managed<T>> for ManagedValue<T>
source§impl<T> From<ManagedLazy<T>> for ManagedValue<T>
impl<T> From<ManagedLazy<T>> for ManagedValue<T>
source§fn from(value: ManagedLazy<T>) -> Self
fn from(value: ManagedLazy<T>) -> Self
Converts to this type from the input type.
source§impl<T> From<ManagedRef<T>> for ManagedValue<T>
impl<T> From<ManagedRef<T>> for ManagedValue<T>
source§fn from(value: ManagedRef<T>) -> Self
fn from(value: ManagedRef<T>) -> Self
Converts to this type from the input type.
source§impl<T> From<ManagedRefMut<T>> for ManagedValue<T>
impl<T> From<ManagedRefMut<T>> for ManagedValue<T>
source§fn from(value: ManagedRefMut<T>) -> Self
fn from(value: ManagedRefMut<T>) -> Self
Converts to this type from the input type.
source§impl<T> TryFrom<ManagedValue<T>> for Managed<T>
impl<T> TryFrom<ManagedValue<T>> for Managed<T>
source§impl<T> TryFrom<ManagedValue<T>> for ManagedLazy<T>
impl<T> TryFrom<ManagedValue<T>> for ManagedLazy<T>
source§impl<T> TryFrom<ManagedValue<T>> for ManagedRef<T>
impl<T> TryFrom<ManagedValue<T>> for ManagedRef<T>
source§impl<T> TryFrom<ManagedValue<T>> for ManagedRefMut<T>
impl<T> TryFrom<ManagedValue<T>> for ManagedRefMut<T>
Auto Trait Implementations§
impl<T> Freeze for ManagedValue<T>where
T: Freeze,
impl<T> RefUnwindSafe for ManagedValue<T>where
T: RefUnwindSafe,
impl<T> Send for ManagedValue<T>where
T: Send,
impl<T> Sync for ManagedValue<T>where
T: Sync,
impl<T> Unpin for ManagedValue<T>where
T: Unpin,
impl<T> UnwindSafe for ManagedValue<T>where
T: UnwindSafe + RefUnwindSafe,
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