nexus_sdk

Trait Viewable

Source
pub trait Viewable {
    // Required methods
    fn public_input<T: Serialize + DeserializeOwned + Sized>(
        &self,
    ) -> Result<T, IOError>;
    fn exit_code(&self) -> Result<u32, IOError>;
    fn public_output<U: Serialize + DeserializeOwned + Sized>(
        &self,
    ) -> Result<U, IOError>;
    fn associated_data(&self) -> Result<Vec<u8>, IOError>;
    fn logs(&self) -> Result<Vec<String>, IOError>;

    // Provided methods
    fn public_input_digest<T: Serialize + DeserializeOwned + Sized, H: Digest>(
        &self,
    ) -> Result<GenericArray<u8, H::OutputSize>, IOError>
       where <H as OutputSizeUser>::OutputSize: ArrayLength<u8> { ... }
    fn exit_code_digest<H: Digest>(
        &self,
    ) -> Result<GenericArray<u8, H::OutputSize>, IOError>
       where <H as OutputSizeUser>::OutputSize: ArrayLength<u8> { ... }
    fn public_output_digest<U: Serialize + DeserializeOwned + Sized, H: Digest>(
        &self,
    ) -> Result<GenericArray<u8, H::OutputSize>, IOError>
       where <H as OutputSizeUser>::OutputSize: ArrayLength<u8> { ... }
    fn associated_data_digest<H: Digest>(
        &self,
    ) -> Result<GenericArray<u8, H::OutputSize>, IOError>
       where <H as OutputSizeUser>::OutputSize: ArrayLength<u8> { ... }
}
Expand description

A view of an execution capturing the context needed for proof distribution and verification.

Required Methods§

Source

fn public_input<T: Serialize + DeserializeOwned + Sized>( &self, ) -> Result<T, IOError>

Deserialize the public input used for the execution.

Source

fn exit_code(&self) -> Result<u32, IOError>

Deserialize the exit code resulting from the execution.

Source

fn public_output<U: Serialize + DeserializeOwned + Sized>( &self, ) -> Result<U, IOError>

Deserialize the public output resulting from the execution.

Source

fn associated_data(&self) -> Result<Vec<u8>, IOError>

Deserialize the associated data bound into the execution.

Source

fn logs(&self) -> Result<Vec<String>, IOError>

Recover any debug logs produced by the execution.

Provided Methods§

Source

fn public_input_digest<T: Serialize + DeserializeOwned + Sized, H: Digest>( &self, ) -> Result<GenericArray<u8, H::OutputSize>, IOError>
where <H as OutputSizeUser>::OutputSize: ArrayLength<u8>,

Compute a digest over the public input used for the execution.

Source

fn exit_code_digest<H: Digest>( &self, ) -> Result<GenericArray<u8, H::OutputSize>, IOError>
where <H as OutputSizeUser>::OutputSize: ArrayLength<u8>,

Compute a digest over the public output resulting from the execution.

Source

fn public_output_digest<U: Serialize + DeserializeOwned + Sized, H: Digest>( &self, ) -> Result<GenericArray<u8, H::OutputSize>, IOError>
where <H as OutputSizeUser>::OutputSize: ArrayLength<u8>,

Compute a digest over the public output resulting from the execution.

Source

fn associated_data_digest<H: Digest>( &self, ) -> Result<GenericArray<u8, H::OutputSize>, IOError>
where <H as OutputSizeUser>::OutputSize: ArrayLength<u8>,

Compute a digest over the associated data bound into the execution.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Viewable for View

Source§

fn public_input<T: Serialize + DeserializeOwned + Sized>( &self, ) -> Result<T, IOError>

Deserialize the public input used for the execution.

Source§

fn exit_code(&self) -> Result<u32, IOError>

Deserialize the exit code resulting from the execution.

Source§

fn public_output<U: Serialize + DeserializeOwned + Sized>( &self, ) -> Result<U, IOError>

Deserialize the public output resulting from the execution.

Source§

fn associated_data(&self) -> Result<Vec<u8>, IOError>

Deserialize the associated data bound into the execution.

Source§

fn logs(&self) -> Result<Vec<String>, IOError>

Recover any debug logs produced by the execution.

Implementors§