Skip to main content

rib/compiler/
compiler_output.rs

1// Copyright 2024-2025 Golem Cloud
2//
3// Licensed under the Golem Source License v1.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://license.golem.cloud/LICENSE
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use crate::compiler::worker_functions_in_rib::WorkerFunctionsInRib;
16use crate::{RibByteCode, RibInputTypeInfo, RibOutputTypeInfo};
17
18#[derive(Debug, Clone)]
19pub struct CompilerOutput {
20    pub worker_invoke_calls: Option<WorkerFunctionsInRib>,
21    pub byte_code: RibByteCode,
22    pub rib_input_type_info: RibInputTypeInfo,
23    // Optional to keep backward compatible as compiler output information
24    // for some existing Rib in persistence store doesn't have this info.
25    // This is optional mainly to support the proto conversions.
26    // At the API level, if we have access to expr, whenever this field is optional
27    // we can compile the expression again and get the output type info
28    pub rib_output_type_info: Option<RibOutputTypeInfo>,
29}