Expand description
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);