snarkvm_circuit_program/
lib.rs

1// Copyright 2024 Aleo Network Foundation
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
23mod data;
24pub use data::*;
25
26mod function_id;
27pub use function_id::*;
28
29mod id;
30pub use id::*;
31
32mod request;
33pub use request::*;
34
35mod response;
36pub use response::*;
37
38mod state_path;
39pub use state_path::*;
40
41use snarkvm_circuit_network::Aleo;
42use snarkvm_circuit_types::{Boolean, environment::prelude::*};
43
44pub trait Visibility<A: Aleo>:
45    Equal<Self, Output = <Self as ToBits>::Boolean> + ToBits<Boolean = Boolean<A>> + FromBits + ToFields + FromFields
46{
47    /// Returns the number of field elements to encode `self`.
48    fn size_in_fields(&self) -> u16;
49}