Struct pbc_contract_common::zk::ZkState
source · #[non_exhaustive]#[repr(C)]pub struct ZkState<SecretVarMetadataT> {
pub calculation_state: CalculationStatus,
pub pending_inputs: AvlTreeMap<SecretVarId, ZkClosed<SecretVarMetadataT>>,
pub secret_variables: AvlTreeMap<SecretVarId, ZkClosed<SecretVarMetadataT>>,
pub data_attestations: AvlTreeMap<AttestationId, DataAttestation>,
pub event_subscriptions: AvlTreeMap<EventSubscriptionId, EventSubscription>,
pub external_events: AvlTreeMap<ExternalEventId, ExternalEvent>,
}
Expand description
Stores and tracks state changes
<SecretMetadataT>
: Public state stored along with each variable.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.calculation_state: CalculationStatus
The MPC’s current state.
pending_inputs: AvlTreeMap<SecretVarId, ZkClosed<SecretVarMetadataT>>
Variables that are in the process of being input.
secret_variables: AvlTreeMap<SecretVarId, ZkClosed<SecretVarMetadataT>>
Secret variables that have been commited to.
data_attestations: AvlTreeMap<AttestationId, DataAttestation>
Attested data
event_subscriptions: AvlTreeMap<EventSubscriptionId, EventSubscription>
Event subscriptions
external_events: AvlTreeMap<ExternalEventId, ExternalEvent>
External events
Implementations§
source§impl<SecretVarMetadataT: ReadWriteState> ZkState<SecretVarMetadataT>
impl<SecretVarMetadataT: ReadWriteState> ZkState<SecretVarMetadataT>
sourcepub fn get_pending_input(
&self,
id: SecretVarId
) -> Option<ZkClosed<SecretVarMetadataT>>
pub fn get_pending_input( &self, id: SecretVarId ) -> Option<ZkClosed<SecretVarMetadataT>>
Utility method for finding pending input with given id
sourcepub fn get_variable(
&self,
id: SecretVarId
) -> Option<ZkClosed<SecretVarMetadataT>>
pub fn get_variable( &self, id: SecretVarId ) -> Option<ZkClosed<SecretVarMetadataT>>
Utility method for finding variable with given id
sourcepub fn get_attestation(
&self,
attestation_id: AttestationId
) -> Option<DataAttestation>
pub fn get_attestation( &self, attestation_id: AttestationId ) -> Option<DataAttestation>
Utility method for finding attestation by attestation id
Trait Implementations§
source§impl<MetadataT: ReadWriteState> ReadRPC for ZkState<MetadataT>
impl<MetadataT: ReadWriteState> ReadRPC for ZkState<MetadataT>
source§fn rpc_read_from<T: Read>(reader: &mut T) -> Self
fn rpc_read_from<T: Read>(reader: &mut T) -> Self
Deserialization method for RPC arguments.
Auto Trait Implementations§
impl<SecretVarMetadataT> RefUnwindSafe for ZkState<SecretVarMetadataT>where
SecretVarMetadataT: RefUnwindSafe,
impl<SecretVarMetadataT> Send for ZkState<SecretVarMetadataT>where
SecretVarMetadataT: Send,
impl<SecretVarMetadataT> Sync for ZkState<SecretVarMetadataT>where
SecretVarMetadataT: Sync,
impl<SecretVarMetadataT> Unpin for ZkState<SecretVarMetadataT>where
SecretVarMetadataT: Unpin,
impl<SecretVarMetadataT> UnwindSafe for ZkState<SecretVarMetadataT>where
SecretVarMetadataT: UnwindSafe,
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