pub struct Managed<T> { /* private fields */ }
Implementations§
Source§impl<T> Managed<T>
impl<T> Managed<T>
pub fn new(data: T) -> Self
pub fn new_raw(data: T, lifetime: Lifetime) -> Self
pub fn into_inner(self) -> (Lifetime, T)
pub fn into_dynamic(self) -> Option<DynamicManaged>
pub fn renew(self) -> Self
pub fn lifetime(&self) -> &Lifetime
pub fn read(&self) -> Option<ValueReadAccess<'_, T>>
pub fn write(&mut self) -> Option<ValueWriteAccess<'_, T>>
pub fn consume(self) -> Result<T, Self>
pub fn move_into_ref(self, target: ManagedRefMut<T>) -> Result<(), Self>
pub fn move_into_lazy(self, target: ManagedLazy<T>) -> Result<(), Self>
pub fn borrow(&self) -> Option<ManagedRef<T>>
pub fn borrow_mut(&mut self) -> Option<ManagedRefMut<T>>
pub fn lazy(&mut self) -> ManagedLazy<T>
Sourcepub unsafe fn try_map<U>(
self,
f: impl FnOnce(T) -> Option<U>,
) -> Option<Managed<U>>
pub unsafe fn try_map<U>( self, f: impl FnOnce(T) -> Option<U>, ) -> Option<Managed<U>>
§Safety
Sourcepub unsafe fn as_mut_ptr(&mut self) -> *mut T
pub unsafe fn as_mut_ptr(&mut self) -> *mut T
§Safety
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Managed<T>where
T: Freeze,
impl<T> RefUnwindSafe for Managed<T>where
T: RefUnwindSafe,
impl<T> Send for Managed<T>where
T: Send,
impl<T> Sync for Managed<T>where
T: Sync,
impl<T> Unpin for Managed<T>where
T: Unpin,
impl<T> UnwindSafe for Managed<T>where
T: UnwindSafe,
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