pub struct ProtocolContractRegistry { /* private fields */ }Expand description
Registry for managing protocol contracts
Implementations§
Source§impl ProtocolContractRegistry
impl ProtocolContractRegistry
Sourcepub fn register(&mut self, contract: Box<dyn ProtocolContract>)
pub fn register(&mut self, contract: Box<dyn ProtocolContract>)
Register a contract
Sourcepub fn get(&self, contract_id: &str) -> Option<&dyn ProtocolContract>
pub fn get(&self, contract_id: &str) -> Option<&dyn ProtocolContract>
Get a contract by ID
Sourcepub fn list(&self) -> Vec<&dyn ProtocolContract>
pub fn list(&self) -> Vec<&dyn ProtocolContract>
List all contracts
Sourcepub fn list_by_protocol(&self, protocol: Protocol) -> Vec<&dyn ProtocolContract>
pub fn list_by_protocol(&self, protocol: Protocol) -> Vec<&dyn ProtocolContract>
List contracts by protocol
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProtocolContractRegistry
impl !RefUnwindSafe for ProtocolContractRegistry
impl Send for ProtocolContractRegistry
impl Sync for ProtocolContractRegistry
impl Unpin for ProtocolContractRegistry
impl UnsafeUnpin for ProtocolContractRegistry
impl !UnwindSafe for ProtocolContractRegistry
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