radicle_cob::change::store

Trait Storage

Source
pub trait Storage {
    type StoreError: Error + Send + Sync + 'static;
    type LoadError: Error + Send + Sync + 'static;
    type ObjectId;
    type Parent;
    type Signatures;

    // Required methods
    fn store<G>(
        &self,
        resource: Option<Self::Parent>,
        related: Vec<Self::Parent>,
        signer: &G,
        template: Template<Self::ObjectId>,
    ) -> Result<Entry<Self::Parent, Self::ObjectId, Self::Signatures>, Self::StoreError>
       where G: Signer;
    fn load(
        &self,
        id: Self::ObjectId,
    ) -> Result<Entry<Self::Parent, Self::ObjectId, Self::Signatures>, Self::LoadError>;
    fn parents_of(&self, id: &Oid) -> Result<Vec<Oid>, Self::LoadError>;
}
Expand description

Change entry storage.

Required Associated Types§

Required Methods§

Source

fn store<G>( &self, resource: Option<Self::Parent>, related: Vec<Self::Parent>, signer: &G, template: Template<Self::ObjectId>, ) -> Result<Entry<Self::Parent, Self::ObjectId, Self::Signatures>, Self::StoreError>
where G: Signer,

Store a new change entry.

Source

fn load( &self, id: Self::ObjectId, ) -> Result<Entry<Self::Parent, Self::ObjectId, Self::Signatures>, Self::LoadError>

Load a change entry.

Source

fn parents_of(&self, id: &Oid) -> Result<Vec<Oid>, Self::LoadError>

Returns the parents of the object with the specified ID.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Storage for Repository

Source§

type StoreError = Create

Source§

type LoadError = Load

Source§

type ObjectId = Oid

Source§

type Parent = Oid

Source§

type Signatures = ExtendedSignature

Source§

fn store<Signer>( &self, resource: Option<Self::Parent>, related: Vec<Self::Parent>, signer: &Signer, spec: Template<Self::ObjectId>, ) -> Result<Entry, Self::StoreError>
where Signer: Signer,

Source§

fn parents_of(&self, id: &Oid) -> Result<Vec<Oid>, Self::LoadError>

Source§

fn load(&self, id: Self::ObjectId) -> Result<Entry, Self::LoadError>

Implementors§