Skip to main content

HiddenStateCodec

Trait HiddenStateCodec 

Source
pub trait HiddenStateCodec {
    type State;

    // Required methods
    fn encode(&self, env: &Env, state: &Self::State) -> Result<Bytes, ZKError>;
    fn decode(&self, env: &Env, encoded: &Bytes) -> Result<Self::State, ZKError>;
}
Expand description

Stable interface for hidden-state encoding.

Hidden-state codecs define the exact byte-level representation used before a caller commits to or stores private state metadata.

Required Associated Types§

Required Methods§

Source

fn encode(&self, env: &Env, state: &Self::State) -> Result<Bytes, ZKError>

Source

fn decode(&self, env: &Env, encoded: &Bytes) -> Result<Self::State, ZKError>

Implementors§