#[repr(C)]
pub struct ZkInputDef<MetadataT, SecretT: SecretBinary> { /* private fields */ }
Expand description

Contains initialization information about Zk variables. Exclusively needed for the zk_on_secret_input hook.

<MetadataT> is the type of the piece of public information associated with the variable.

Implementations§

source§

impl<MetadataT, SecretT: SecretBinary + SecretBinaryFixedSize> ZkInputDef<MetadataT, SecretT>

source

pub fn with_metadata( shortname: Option<ShortnameZkVariableInputted>, metadata: MetadataT ) -> Self

Create new ZkInputDef with the given metadata, and a fixed size from the secret type ´SecretT`.

This method requires ‘SecretT’ to possess a fixed size. For types that do not posses a fixed size, for example Vecors, use ZkInputDef::with_metadata_and_size

source§

impl<MetadataT, SecretT: SecretBinary> ZkInputDef<MetadataT, SecretT>

source

pub fn with_metadata_and_size( shortname: Option<ShortnameZkVariableInputted>, metadata: MetadataT, secret_size: u32 ) -> Self

Create new ZkInputDef with the given metadata and size.

secret_size specifies the size of the secret variable in bits.

Prefer ZkInputDef::with_metadata when your type has a fixed size, as it is much easier to use. Only use this method when using dynamically sized data, like Vectors. This method requires you to know precisely how much data to secret-share, and providing the wrong secret_sizecould prevent usage.

Trait Implementations§

source§

impl<MetadataT: Debug, SecretT: Debug + SecretBinary> Debug for ZkInputDef<MetadataT, SecretT>

source§

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

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

impl<MetadataT: ReadWriteState, SecretT: SecretBinary> WriteRPC for ZkInputDef<MetadataT, SecretT>

source§

fn rpc_write_to<T: Write>(&self, writer: &mut T) -> Result<()>

Serialization method for RPC arguments.

Auto Trait Implementations§

§

impl<MetadataT, SecretT> RefUnwindSafe for ZkInputDef<MetadataT, SecretT>
where MetadataT: RefUnwindSafe, SecretT: RefUnwindSafe,

§

impl<MetadataT, SecretT> Send for ZkInputDef<MetadataT, SecretT>
where MetadataT: Send, SecretT: Send,

§

impl<MetadataT, SecretT> Sync for ZkInputDef<MetadataT, SecretT>
where MetadataT: Sync, SecretT: Sync,

§

impl<MetadataT, SecretT> Unpin for ZkInputDef<MetadataT, SecretT>
where MetadataT: Unpin, SecretT: Unpin,

§

impl<MetadataT, SecretT> UnwindSafe for ZkInputDef<MetadataT, SecretT>
where MetadataT: UnwindSafe, SecretT: 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.