Skip to main content

Rcb

Trait Rcb 

Source
pub trait Rcb<T>: Clone + Deref<Target = T> {
    type Weak: WeakRcb<T>;

    // Required methods
    fn new(x: T) -> Self;
    fn try_unwrap(this: Self) -> Result<T, Self>;
    fn downgrade(this: &Self) -> Self::Weak;
}
Expand description

Trait for reference-counted boxes.

Required Associated Types§

Required Methods§

Source

fn new(x: T) -> Self

Source

fn try_unwrap(this: Self) -> Result<T, Self>

Source

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

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> Rcb<T> for Arc<T>

Source§

type Weak = Weak<T>

Source§

fn new(x: T) -> Self

Source§

fn try_unwrap(this: Self) -> Result<T, Self>

Source§

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

Source§

impl<T> Rcb<T> for Rc<T>

Source§

type Weak = Weak<T>

Source§

fn new(x: T) -> Self

Source§

fn try_unwrap(this: Self) -> Result<T, Self>

Source§

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

Implementors§