Type Alias UpgradeIntoFn

Source
pub type UpgradeIntoFn = for<'ptr> unsafe fn(PtrMut<'ptr>, PtrUninit<'ptr>) -> Option<PtrMut<'ptr>>;
Expand description

Tries to upgrade the weak pointer to a strong one.

If the upgrade succeeds, initializes the smart pointer into the given strong, and returns a copy of strong, which has been guaranteed to be initialized. If the upgrade fails, None is returned and strong is not initialized.

weak is not moved out of.

ยงSafety

weak must be a valid weak smart pointer (like std::sync::Weak or std::rc::Weak).

strong must be allocated, and of the right layout for the corresponding smart pointer.

strong must not have been initialized yet.