[][src]Crate rc_borrow

Borrowed forms of [Rc] and [Arc].

ArcBorrow<_> is functionally equivalent to &Arc<_>, but it's represented as &T, avoiding the extra indirection.

Examples

let resource: Arc<Resource> = acquire_resource();
let borrowed: ArcBorrow<'_, Resource> = (&resource).into();
let reference: &Resource = ArcBorrow::downgrade(borrowed);
let cloned: Arc<Resource> = ArcBorrow::upgrade(borrowed);
fn use_resource(resource: &Resource) { /* ... */ }
use_resource(&borrowed);

Structs

ArcBorrow

Borrowed version of [Arc].

RcBorrow

Borrowed version of [Rc].