glib::clone

Trait Downgrade

Source
pub trait Downgrade
where Self: Sized,
{ type Weak: Upgrade; // Required method fn downgrade(&self) -> Self::Weak; }
Expand description

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

Required Associated Types§

Source

type Weak: Upgrade

Weak reference type.

Required Methods§

Source

fn downgrade(&self) -> Self::Weak

Downgrade to a weak reference.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> Downgrade for Rc<T>

Source§

type Weak = Weak<T>

Source§

fn downgrade(&self) -> Self::Weak

Source§

impl<T> Downgrade for Arc<T>

Source§

type Weak = Weak<T>

Source§

fn downgrade(&self) -> Self::Weak

Source§

impl<T> Downgrade for PhantomData<T>

Source§

type Weak = PhantomData<T>

Source§

fn downgrade(&self) -> Self::Weak

Source§

impl<T: Downgrade> Downgrade for &T

Source§

type Weak = <T as Downgrade>::Weak

Source§

fn downgrade(&self) -> Self::Weak

Implementors§