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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Storage for Repository

§

type StoreError = Create

§

type LoadError = Load

§

type ObjectId = Oid

§

type Parent = Oid

§

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§