snarkvm_circuit_program/
lib.rs

1// Copyright (c) 2019-2025 Provable Inc.
2// This file is part of the snarkVM library.
3
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at:
7
8// http://www.apache.org/licenses/LICENSE-2.0
9
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#![forbid(unsafe_code)]
17#![allow(clippy::too_many_arguments)]
18#![cfg_attr(test, allow(clippy::assertions_on_result_states))]
19
20#[cfg(test)]
21use snarkvm_circuit_network::AleoV0 as Circuit;
22
23#[cfg(test)]
24extern crate snarkvm_console as console_root;
25
26extern crate snarkvm_console_program as console;
27
28mod data;
29pub use data::*;
30
31mod function_id;
32pub use function_id::*;
33
34mod id;
35pub use id::*;
36
37mod request;
38pub use request::*;
39
40mod response;
41pub use response::*;
42
43mod state_path;
44pub use state_path::*;
45
46use snarkvm_circuit_network::Aleo;
47use snarkvm_circuit_types::{Boolean, environment::prelude::*};
48
49pub trait Visibility<A: Aleo>:
50    Equal<Self, Output = <Self as ToBits>::Boolean> + ToBits<Boolean = Boolean<A>> + FromBits + ToFields + FromFields
51{
52    /// Returns the number of field elements to encode `self`.
53    fn size_in_fields(&self) -> u16;
54}