pub trait VersioningFactory {
type Output;
type Error;
type Arguments;
// Required methods
fn get_component() -> MipComponent;
fn get_versioning_store(&self) -> MipStore;
fn create(
&self,
args: &Self::Arguments,
strategy: FactoryStrategy,
) -> Result<Self::Output, Self::Error>;
// Provided methods
fn get_latest_component_version_at(
&self,
ts: MassaTime,
) -> Result<u32, FactoryError> { ... }
fn get_all_active_component_versions(&self) -> Vec<u32> { ... }
fn get_all_component_versions(&self) -> BTreeMap<u32, ComponentStateTypeId> { ... }
fn get_component_version_with_strategy(
&self,
strategy: FactoryStrategy,
) -> Result<u32, FactoryError> { ... }
}
Expand description
Trait for Factory that create objects based on versioning store
Required Associated Types§
Required Methods§
sourcefn get_component() -> MipComponent
fn get_component() -> MipComponent
Return the MipComponent associated with return type (Output) e.g. if type Output = Address, should return MipComponent::Address
sourcefn get_versioning_store(&self) -> MipStore
fn get_versioning_store(&self) -> MipStore
Access to the MipStore
Provided Methods§
sourcefn get_latest_component_version_at(
&self,
ts: MassaTime,
) -> Result<u32, FactoryError>
fn get_latest_component_version_at( &self, ts: MassaTime, ) -> Result<u32, FactoryError>
Get latest version at given timestamp (e.g. slot)
sourcefn get_all_active_component_versions(&self) -> Vec<u32>
fn get_all_active_component_versions(&self) -> Vec<u32>
Get all versions in ‘Active state’ for the associated MipComponent
sourcefn get_all_component_versions(&self) -> BTreeMap<u32, ComponentStateTypeId>
fn get_all_component_versions(&self) -> BTreeMap<u32, ComponentStateTypeId>
Get all versions (at any state) for the associated MipComponent
sourcefn get_component_version_with_strategy(
&self,
strategy: FactoryStrategy,
) -> Result<u32, FactoryError>
fn get_component_version_with_strategy( &self, strategy: FactoryStrategy, ) -> Result<u32, FactoryError>
Get the version the current component with the given strategy
Object Safety§
This trait is not object safe.