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§fn from(value: Managed<T>) -> ManagedValue<T>
fn from(value: Managed<T>) -> ManagedValue<T>
Converts to this type from the input type.
source§impl<T> From<ManagedLazy<T>> for ManagedValue<T>
impl<T> From<ManagedLazy<T>> for ManagedValue<T>
source§fn from(value: ManagedLazy<T>) -> ManagedValue<T>
fn from(value: ManagedLazy<T>) -> ManagedValue<T>
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>) -> ManagedValue<T>
fn from(value: ManagedRef<T>) -> ManagedValue<T>
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>) -> ManagedValue<T>
fn from(value: ManagedRefMut<T>) -> ManagedValue<T>
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§fn try_from(
value: ManagedValue<T>,
) -> Result<ManagedLazy<T>, <ManagedLazy<T> as TryFrom<ManagedValue<T>>>::Error>
fn try_from( value: ManagedValue<T>, ) -> Result<ManagedLazy<T>, <ManagedLazy<T> as TryFrom<ManagedValue<T>>>::Error>
Performs the conversion.
source§impl<T> TryFrom<ManagedValue<T>> for ManagedRef<T>
impl<T> TryFrom<ManagedValue<T>> for ManagedRef<T>
source§fn try_from(
value: ManagedValue<T>,
) -> Result<ManagedRef<T>, <ManagedRef<T> as TryFrom<ManagedValue<T>>>::Error>
fn try_from( value: ManagedValue<T>, ) -> Result<ManagedRef<T>, <ManagedRef<T> as TryFrom<ManagedValue<T>>>::Error>
Performs the conversion.
source§impl<T> TryFrom<ManagedValue<T>> for ManagedRefMut<T>
impl<T> TryFrom<ManagedValue<T>> for ManagedRefMut<T>
source§fn try_from(
value: ManagedValue<T>,
) -> Result<ManagedRefMut<T>, <ManagedRefMut<T> as TryFrom<ManagedValue<T>>>::Error>
fn try_from( value: ManagedValue<T>, ) -> Result<ManagedRefMut<T>, <ManagedRefMut<T> as TryFrom<ManagedValue<T>>>::Error>
Performs the conversion.
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