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§