Skip to main content

Upgrade

Trait Upgrade 

Source
pub trait Upgrade
where Self: Sized,
{ type Strong; // Required method fn upgrade(&self) -> Option<Self::Strong>; }
Expand description

Trait for generalizing upgrading a weak reference to a strong reference.

Required Associated Types§

Source

type Strong

Strong reference type.

Required Methods§

Source

fn upgrade(&self) -> Option<Self::Strong>

Try upgrading a weak reference to a strong reference.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> Upgrade for Weak<T>

Source§

type Strong = Rc<T>

Source§

fn upgrade(&self) -> Option<Self::Strong>

Source§

impl<T> Upgrade for Weak<T>

Source§

type Strong = Arc<T>

Source§

fn upgrade(&self) -> Option<Self::Strong>

Source§

impl<T> Upgrade for PhantomData<T>

Implementors§