Arc

Type Alias Arc 

Source
pub type Arc<T> = Arc<T>;
Expand description

A conditionally compiled atomic or non-atomic reference counter. In this target it’s backed by std::sync::Arc<T>.

Aliased Type§

pub struct Arc<T> { /* private fields */ }

Trait Implementations§

Source§

impl<T: Storable + CondSync> Storable for Arc<T>

Source§

type Serializable = <T as Storable>::Serializable

The at-rest representation of this storable type.
Source§

async fn to_serializable( &self, store: &impl BlockStore, ) -> Result<Self::Serializable>

Turn the current type into the at-rest representation of this type.
Source§

async fn from_serializable( cid: Option<&Cid>, serializable: Self::Serializable, ) -> Result<Self>

Take an at-rest representation of this type and turn it into the in-memory representation. You can use the cid parameter to populate a cache.
Source§

fn persisted_as(&self) -> Option<&OnceCell<Cid>>

Return a serialization cache, if it exists. By default, this always returns None.
Source§

fn store( &self, store: &impl BlockStore, ) -> impl Future<Output = Result<Cid>> + CondSend
where Self: CondSync,

Store this data type in a given BlockStore. Read more
Source§

fn load( cid: &Cid, store: &impl BlockStore, ) -> impl Future<Output = Result<Self>> + CondSend

Try to load a value of this type from a CID. Read more