Type Alias DowngradeIntoFn

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

Downgrades a strong pointer to a weak one.

Initializes the smart pointer into the given weak, and returns a copy of weak, which has been guaranteed to be initialized.

Only strong pointers can be downgraded (like std::sync::Arc or std::rc::Rc).

ยงSafety

strong must be a valid strong smart pointer (like std::sync::Arc or std::rc::Rc).

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

weak must not have been initialized yet.