pub struct ModelRegistryModule { /* private fields */ }Implementations§
Source§impl ModelRegistryModule
impl ModelRegistryModule
pub fn new() -> Self
pub fn register_model(&mut self, model: Model) -> Result<(), RuntimeError>
pub fn get_model(&self, model_id: &Hash32) -> Option<&Model>
pub fn get_model_mut(&mut self, model_id: &Hash32) -> Option<&mut Model>
pub fn update_version( &mut self, model_id: &Hash32, new_version: u32, new_shard_root: Hash32, ) -> Result<(), RuntimeError>
pub fn set_model_state( &mut self, model_id: &Hash32, state: ModelState, ) -> Result<(), RuntimeError>
pub fn update_pricing( &mut self, model_id: &Hash32, policy: PricingPolicy, ) -> Result<(), RuntimeError>
pub fn update_revenue_split( &mut self, model_id: &Hash32, split: RevenueSplit, ) -> Result<(), RuntimeError>
pub fn transfer_ownership( &mut self, model_id: &Hash32, new_owner: Address, ) -> Result<(), RuntimeError>
pub fn all_models(&self) -> &HashMap<Hash32, Model>
pub fn is_active(&self, model_id: &Hash32) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelRegistryModule
impl RefUnwindSafe for ModelRegistryModule
impl Send for ModelRegistryModule
impl Sync for ModelRegistryModule
impl Unpin for ModelRegistryModule
impl UnsafeUnpin for ModelRegistryModule
impl UnwindSafe for ModelRegistryModule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more