Skip to main content

RefCounter

Trait RefCounter 

Source
pub trait RefCounter:
    Clone
    + Sized
    + Deref<Target = Box<[u8]>>
    + From<Box<[u8]>> {
    // Required method
    fn try_unwrap(self) -> Result<Box<[u8]>, Self>;
}
Expand description

A trait to allow SharedString to be generic over any reference counter.

Implemented for Rc and Arc.

Requires the traits Clone + Sized + Deref<Box<[u8]>> + From<Box<[u8]>>

Required Methods§

Source

fn try_unwrap(self) -> Result<Box<[u8]>, Self>

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 RefCounter for Arc<Box<[u8]>>

Source§

fn try_unwrap(self) -> Result<Box<[u8]>, Self>

Source§

impl RefCounter for Rc<Box<[u8]>>

Source§

fn try_unwrap(self) -> Result<Box<[u8]>, Self>

Implementors§