UpgradeIntoFn

Type Alias UpgradeIntoFn 

Source
pub type UpgradeIntoFn = unsafe fn(weak: PtrMut, strong: PtrUninit) -> Option<PtrMut>;
Expand description

Tries to upgrade the weak pointer to a strong one.

If the upgrade succeeds, initializes the 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 pointer (like alloc::sync::Weak or alloc::rc::Weak).

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

strong must not have been initialized yet.