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
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.