#[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>

source

pub fn get_pending_input( &self, id: SecretVarId ) -> Option<ZkClosed<SecretVarMetadataT>>

Utility method for finding pending input with given id

source

pub fn get_variable( &self, id: SecretVarId ) -> Option<ZkClosed<SecretVarMetadataT>>

Utility method for finding variable with given id

source

pub fn get_attestation( &self, attestation_id: AttestationId ) -> Option<DataAttestation>

Utility method for finding attestation by attestation id

Trait Implementations§

source§

impl<SecretVarMetadataT: Debug> Debug for ZkState<SecretVarMetadataT>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<MetadataT: ReadWriteState> ReadRPC for ZkState<MetadataT>

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.