pub struct ProtocolComponentState {
pub component_id: ComponentId,
pub attributes: HashMap<AttrStoreKey, StoreVal>,
pub balances: HashMap<Address, Balance>,
}Fields§
§component_id: ComponentId§attributes: HashMap<AttrStoreKey, StoreVal>§balances: HashMap<Address, Balance>Implementations§
Source§impl ProtocolComponentState
impl ProtocolComponentState
pub fn new( component_id: &str, attributes: HashMap<AttrStoreKey, StoreVal>, balances: HashMap<Address, Balance>, ) -> Self
Sourcepub fn apply_state_delta(
&mut self,
delta: &ProtocolComponentStateDelta,
) -> Result<(), MergeError>
pub fn apply_state_delta( &mut self, delta: &ProtocolComponentStateDelta, ) -> Result<(), MergeError>
Applies state deltas to this state.
This method assumes that the passed delta is “newer” than the current state.
Sourcepub fn apply_balance_delta(
&mut self,
delta: &HashMap<Bytes, ComponentBalance>,
) -> Result<(), MergeError>
pub fn apply_balance_delta( &mut self, delta: &HashMap<Bytes, ComponentBalance>, ) -> Result<(), MergeError>
Applies balance deltas to this state.
This method assumes that the passed delta is “newer” than the current state.
Trait Implementations§
Source§impl Clone for ProtocolComponentState
impl Clone for ProtocolComponentState
Source§fn clone(&self) -> ProtocolComponentState
fn clone(&self) -> ProtocolComponentState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProtocolComponentState
impl Debug for ProtocolComponentState
Source§impl From<ProtocolComponentState> for ResponseProtocolState
impl From<ProtocolComponentState> for ResponseProtocolState
Source§fn from(value: ProtocolComponentState) -> Self
fn from(value: ProtocolComponentState) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ProtocolComponentState
impl PartialEq for ProtocolComponentState
impl StructuralPartialEq for ProtocolComponentState
Auto Trait Implementations§
impl Freeze for ProtocolComponentState
impl RefUnwindSafe for ProtocolComponentState
impl Send for ProtocolComponentState
impl Sync for ProtocolComponentState
impl Unpin for ProtocolComponentState
impl UnwindSafe for ProtocolComponentState
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