pub trait ContainerManifest: Debug + Send + Sync {
    // Required methods
    fn version(&self) -> u64;
    fn get_storages(&self) -> CatlibResult<Vec<Vec<u8>>>;
    fn add_storage(&self, storage: Vec<u8>) -> CatlibResult<()>;
    fn overwrite_storages(&self, storages: Vec<Vec<u8>>) -> CatlibResult<()>;
    fn delete(&self) -> CatlibResult<()>;
    fn forest(&self) -> CatlibResult<Arc<dyn ForestManifest>>;
    fn uuid(&self) -> Uuid;
    fn change_path(&self, path: ContainerPath) -> CatlibResult<()>;
    fn get_path(&self) -> CatlibResult<ContainerPath>;
    fn owner(&self) -> CatlibResult<WildlandPubKey>;
    fn data(&self) -> CatlibResult<Vec<u8>>;
    fn set_data(&self, data: Vec<u8>) -> CatlibResult<()>;
}
Expand description

ContainerManifest trait is an API providing methods needed to manipulate container’s configuration state. It should be implemented by Cat-Lib instance and should be treated as a kind of a proxy layer between Wildland Core and the external persistent data storage instance (for e.g. database).

Required Methods§

source

fn version(&self) -> u64

source

fn get_storages(&self) -> CatlibResult<Vec<Vec<u8>>>

Lists the storages that the given container use in order to keep the data.

source

fn add_storage(&self, storage: Vec<u8>) -> CatlibResult<()>

This operation adds a given Storage Backend to the container. The procedure involves starting the data sync mechanism between the new storage and the other present storages.

Container can have multiple storages. Given container should has exact copies of the data on every storage.

source

fn overwrite_storages(&self, storages: Vec<Vec<u8>>) -> CatlibResult<()>

Overwrites the storages of a container

Storages vector cannot be empty

source

fn delete(&self) -> CatlibResult<()>

Deletes all records regarding the container from the database.

source

fn forest(&self) -> CatlibResult<Arc<dyn ForestManifest>>

Return crate::Forest that contains the crate::Container.

source

fn uuid(&self) -> Uuid

Returns the unique ID of the container.

source

fn change_path(&self, path: ContainerPath) -> CatlibResult<()>

Overrides container path.

source

fn get_path(&self) -> CatlibResult<ContainerPath>

Get path from the given container.

source

fn owner(&self) -> CatlibResult<WildlandPubKey>

Retrieve Forest’s owner identity

source

fn data(&self) -> CatlibResult<Vec<u8>>

Retrieves containers arbitrary metadata

source

fn set_data(&self, data: Vec<u8>) -> CatlibResult<()>

Sets metadata

Implementors§